-
Notifications
You must be signed in to change notification settings - Fork 36
/
actions_bootstrap_for_e2e_tests.ps1
37 lines (32 loc) · 1.26 KB
/
actions_bootstrap_for_e2e_tests.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
# Bootstrap dependencies
# https://docs.microsoft.com/powershell/module/packagemanagement/get-packageprovider
Get-PackageProvider -Name Nuget -ForceBootstrap | Out-Null
# https://docs.microsoft.com/powershell/module/powershellget/set-psrepository
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
# List of PowerShell Modules required for the build
$modulesToInstall = [System.Collections.ArrayList]::new()
# https://github.com/nightroman/Invoke-Build
$null = $modulesToInstall.Add(([PSCustomObject]@{
ModuleName = 'InvokeBuild'
ModuleVersion = '5.10.2'
}))
'Installing PowerShell Modules'
foreach ($module in $modulesToInstall) {
$installSplat = @{
Name = $module.ModuleName
RequiredVersion = $module.ModuleVersion
Repository = 'PSGallery'
SkipPublisherCheck = $true
Force = $true
ErrorAction = 'Stop'
}
try {
Install-Module @installSplat
Import-Module -Name $module.ModuleName -ErrorAction Stop
' - Successfully installed {0}' -f $module.ModuleName
} catch {
$message = 'Failed to install {0}' -f $module.ModuleName
" - $message"
throw
}
}