-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.ps1
31 lines (25 loc) · 1.16 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
[string[]]$PowerShellModules = @("Pester", "posh-git", "platyPS", "InvokeBuild")
[string[]]$PackageProviders = @('NuGet', 'PowerShellGet')
[string[]]$ChocolateyPackages = @('nodejs', 'calibre')
[string[]]$NodeModules = @('gitbook-cli', 'gitbook-summary')
# Line break for readability in AppVeyor console
Write-Host -Object ''
# Install package providers for PowerShell Modules
ForEach ($Provider in $PackageProviders) {
If (!(Get-PackageProvider $Provider -ErrorAction SilentlyContinue)) {
Install-PackageProvider $Provider -Force -ForceBootstrap -Scope CurrentUser
}
}
# Install the PowerShell Modules
ForEach ($Module in $PowerShellModules) {
If (!(Get-Module -ListAvailable $Module -ErrorAction SilentlyContinue)) {
Install-Module $Module -Scope CurrentUser -Force -Repository PSGallery
}
Import-Module $Module
}
# Install Chocolatey
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# Install Chocolatey packages
ForEach ($Package in $ChocolateyPackages) {choco install $Package -y --no-progress}
# Install Node packages
ForEach ($Module in $NodeModules) {npm install -g $Module}