-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.ps1
35 lines (29 loc) · 893 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
[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)) {
Write-Host "Installing NuGet package provider"
Install-PackageProvider NuGet -MinimumVersion 2.8.5.201 -ForceBootstrap -Force
}
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
if (-not (Get-Module -ListAvailable InvokeBuild)) {
Write-Host "Getting InvokeBuild module"
Install-Module InvokeBuild -Scope CurrentUser
}
Import-Module InvokeBuild
Invoke-Build $Task