-
Notifications
You must be signed in to change notification settings - Fork 33
/
Install.ps1
83 lines (73 loc) · 2.71 KB
/
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
[CmdletBinding()]
param([string]$InstallDirectory)
$fileList = @(
### Base module files
'TabExpansionPlusPlus.psm1'
'TabExpansionPlusPlus.psd1'
'about_TabExpansionPlusPlus.help.txt'
'License.txt'
'Convert-ArgumentCompleterRegistrationScript.ps1'
### Completers
'Appx.ArgumentCompleters.ps1'
'BitsTransfer.ArgumentCompleters.ps1'
'CimCmdlets.ArgumentCompleters.ps1'
'DhcpServer.ArgumentCompleters.ps1'
'Dism.ArgumentCompleters.ps1'
'DFSR.ArgumentCompleters.ps1'
'DnsClient.ArgumentCompleters.ps1'
'DnsServer.ArgumentCompleters.ps1'
'FailoverClusters.ArgumentCompleters.ps1'
'GroupPolicy.ArgumentCompleters.ps1'
'Hexo.ArgumentCompleters.ps1'
'Hyper-V.ArgumentCompleters.ps1'
'ISE.ArgumentCompleters.ps1'
'Microsoft.Azure.ArgumentCompleters.ps1'
'Microsoft.AzureRm.ArgumentCompleters.ps1'
'Microsoft.PowerShell.Core.ArgumentCompleters.ps1'
'Microsoft.PowerShell.Diagnostics.ArgumentCompleters.ps1'
'Microsoft.PowerShell.LocalAccounts.ArgumentCompleters.ps1'
'Microsoft.PowerShell.Management.ArgumentCompleters.ps1'
'Microsoft.PowerShell.Utility.ArgumentCompleters.ps1'
'NetAdapter.ArgumentCompleters.ps1'
'NetLbfo.ArgumentCompleters.ps1'
'NetQos.ArgumentCompleters.ps1'
'NetSecurity.ArgumentCompleters.ps1'
'NetTCPIP.ArgumentCompleters.ps1'
'Pnpdevice.ArgumentCompleters.ps1'
'PowerShellDirect.ArgumentCompleters.ps1'
'PowerShellWebAccess.ArgumentCompleters.ps1'
'PrintManagement.ArgumentCompleters.ps1'
'RobocopyExe.ArgumentCompleters.ps1'
'ScheduledTasks.ArgumentCompleters.ps1'
'SmbShare.ArgumentCompleters.ps1'
'Storage.ArgumentCompleters.ps1'
'TabExpansionPlusPlus.ArgumentCompleters.ps1'
'Wdac.ArgumentCompleters.ps1'
'WindowsExe.ArgumentCompleters.ps1'
'WindowsExe.Messages.psd1'
)
if ('' -eq $InstallDirectory)
{
$personalModules = Join-Path -Path ([Environment]::GetFolderPath('MyDocuments')) -ChildPath WindowsPowerShell\Modules
$psModPath = $env:PSModulePath -split ';' | % { $_.Trim('\') }
if ($psModPath -notcontains $personalModules)
{
Write-Warning "$personalModules is not in `$env:PSModulePath"
}
if (!(Test-Path $personalModules))
{
Write-Error "$personalModules does not exist"
}
$InstallDirectory = Join-Path -Path $personalModules -ChildPath TabExpansionPlusPlus
}
if (!(Test-Path $InstallDirectory))
{
$null = mkdir $InstallDirectory
$null = mkdir $InstallDirectory\Snippets
}
$wc = new-object System.Net.WebClient
$fileList | ForEach-Object {
Write-Verbose "Downloading $_"
$wc.DownloadFile("https://raw.github.com/lzybkr/TabExpansionPlusPlus/master/$_",
"$installDirectory\$_")
}