forked from drewgreenwell/ps-menu
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathbuild.ps1
32 lines (25 loc) · 876 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
param ($Task = 'Default')
function Ensure-Module($Name, [Switch]$SkipPublisherCheck, [Switch]$SkipImport) {
if (Get-Module -Name $Name) {
Return
}
if (Get-Module -Name $Name -ListAvailable) {
if (!$SkipImport) {
Import-Module -Name $Name
}
Return
}
Get-PackageProvider -Name NuGet -ForceBootstrap | Out-Null
Install-Module $Name -Scope CurrentUser -SkipPublisherCheck:$SkipPublisherCheck
if (!SkipImport) {
Import-Module -Name $Name
}
}
# Grab nuget bits, install modules, set build variables, start build.
Ensure-Module -Name Psake
Ensure-Module -Name BuildHelpers
Ensure-Module -Name PSDeploy -SkipImport
Ensure-Module -Name Pester -SkipPublisherCheck
Set-BuildEnvironment -Force
Invoke-psake -buildFile .\psake.ps1 -taskList $Task -nologo
exit ( [int]( -not $psake.build_success ) )