-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.ps1
executable file
·37 lines (32 loc) · 904 Bytes
/
build.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
#!/usr/bin/env pwsh
[CmdletBinding()]
param(
[Switch]$BootStrapOnly
)
begin {
$ErrorActionPreference = 'Stop'
Set-Location -LiteralPath $PSScriptRoot
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = '1'
$env:DOTNET_CLI_TELEMETRY_OPTOUT = '1'
$env:DOTNET_NOLOGO = '1'
$requiredModules = @('Pester', 'ShiPS')
}
end {
if ($BootStrapOnly.IsPresent) {
'BootStrapOnly Mode...'
dotnet tool restore
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
foreach ($module in $requiredModules) {
$modAvailable = Get-Module -Name $module -ListAvailable
if (-not $modAvailable) {
Install-Module -Name $module -Repository PSGallery -Scope CurrentUser -Force -Verbose
}
}
}
else {
dotnet cake @args
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
}
}