-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathInstall.ps1
28 lines (23 loc) · 854 Bytes
/
Install.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
[cmdletbinding()]
param()
$man = Test-ModuleManifest $PSScriptRoot/vim/vim.psd1 -ErrorAction 0
$name = "vim"
[string]$version = $man.Version
$moduleSourceDir = "$PSScriptRoot/vim"
$moduleDir = "~/documents/PowerShell/Modules/$name/$version/"
$newLine = [Environment]::NewLine
$ofs = $newLine
[string]$about_content = Get-Content $PSScriptRoot/README.md | ForEach-Object {
$_ -replace '```.*', ''
}
if (-not (Test-Path $moduleDir))
{
$null = mkdir $moduleDir
}
Get-ChildItem $moduleSourceDir | copy -Destination $moduleDir
Set-Content -Path $moduleDir/about_${name}.help.txt -value $about_content -Verbose
$cert =Get-ChildItem cert:\CurrentUser\My -CodeSigningCert
if($cert -ne $null)
{
Get-ChildItem $moduleDir/*.ps?1 | Set-AuthenticodeSignature -Certificate $cert -TimestampServer http://timestamp.verisign.com/scripts/timstamp.dll
}