-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.ps1
39 lines (33 loc) · 873 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
38
39
#Requires -RunAsAdministrator
[cmdletbinding()]
param(
[string[]]$Task = 'default'
)
if (!(Get-PackageProvider -Name Nuget -ErrorAction SilentlyContinue))
{
Install-PackageProvider -Name NuGet -Force
}
$modulesToInstall = @(
'Pester',
'psake',
'PSScriptAnalyzer'
)
ForEach ($module in $modulesToInstall)
{
if (!(Get-Module -Name $module -ListAvailable))
{
Install-Module -Name $module -Force -Scope CurrentUser
}
}
if (-not($env:APPVEYOR))
{
$env:appveyor_build_version = '10.10.10'
Write-Verbose "Not on AppVeyor, using fake version of $($env:appveyor_build_version)."
}
# Invoke PSake
Invoke-psake -buildFile "$PSScriptRoot\psakeBuild.ps1" -taskList $Task -parameters @{'build_version' = $env:appveyor_build_version} -Verbose:$VerbosePreference
if ($psake.build_success -eq $false) {
exit 1
} else {
exit 0
}