-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathBuild-CarbonCLI.ps1
27 lines (21 loc) · 1.02 KB
/
Build-CarbonCLI.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
[CmdletBinding()]
param (
[ValidateSet("CurrentUser", "AllUsers")]
[string]
$Scope = "CurrentUser",
[string]
$MinNugetVersion = "2.8.5.201"
)
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
if ( -not (Get-PackageProvider -Name "NuGet") ) {
Install-PackageProvider -Name NuGet -MinimumVersion $MinNugetVersion -Force -Scope $Scope
}
$RequiredModules = Import-PowerShellDataFile -Path "./build.requirements.psd1"
Write-Output "Installing..."
foreach ($Module in $RequiredModules["requirements"]) {
if ( -not (Get-Module -ListAvailable -Name $Module.ModuleName)) {
Write-Output $Module.ModuleName
Install-Module -Name $Module.ModuleName -Scope AllUsers -RequiredVersion $Module.RequiredVersion -Force -SkipPublisherCheck
}
}
Invoke-ScriptAnalyzer -Path $PSScriptRoot\CarbonCLI\ -Recurse -ExcludeRule PSUseOutputTypeCorrectly, PSReviewUnusedParameter, PSAvoidGlobalVars, PSUseShouldProcessForStateChangingFunctions, PSUseToExportFieldsInManifest, PSUseSingularNouns