-
Notifications
You must be signed in to change notification settings - Fork 25
/
build.ps1
38 lines (34 loc) · 921 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
[CmdletBinding()]
param(
[Parameter()]
[ArgumentCompleter(
{
param($Command, $Parameter, $WordToComplete, $CommandAst, $FakeBoundParams)
$buildTasks = (Invoke-Build ?).Name
if ($WordToComplete) {
$buildTasks.Where{ $_ -match "^$WordToComplete" }
}
else {
$buildTasks
}
}
)]
[string]
$Task = '.'
)
if (-not (Get-PackageProvider NuGet -ErrorAction Ignore -ListAvailable)) {
Write-Host "Installing NuGet package provider"
Install-PackageProvider NuGet -MinimumVersion 2.8.5.201 -ForceBootstrap -Force
}
if (-not (Get-Module -ListAvailable InvokeBuild)) {
Write-Host "Getting InvokeBuild module"
Install-Module InvokeBuild -Scope CurrentUser -Force
}
Import-Module InvokeBuild
Push-Location $PSScriptRoot
try {
Invoke-Build $Task
}
finally {
Pop-Location
}