forked from simpleidserver/SimpleIdServer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
psake.ps1
71 lines (54 loc) · 2.14 KB
/
psake.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Helper script for those who want to run psake without importing the module.
# Example run from PowerShell:
# .\psake.ps1 "psakefile.ps1" "BuildHelloWord" "4.0"
# Must match parameter definitions for psake.psm1/invoke-psake
# otherwise named parameter binding fails
[cmdletbinding()]
param(
[Parameter(Position = 0, Mandatory = $false)]
[string]$buildFile,
[Parameter(Position = 1, Mandatory = $false)]
[string[]]$taskList = @(),
[Parameter(Position = 2, Mandatory = $false)]
[string]$framework,
[Parameter(Position = 3, Mandatory = $false)]
[switch]$docs = $false,
[Parameter(Position = 4, Mandatory = $false)]
[System.Collections.Hashtable]$parameters = @{},
[Parameter(Position = 5, Mandatory = $false)]
[System.Collections.Hashtable]$properties = @{},
[Parameter(Position = 6, Mandatory = $false)]
[alias("init")]
[scriptblock]$initialization = {},
[Parameter(Position = 7, Mandatory = $false)]
[switch]$nologo = $false,
[Parameter(Position = 8, Mandatory = $false)]
[switch]$help = $false,
[Parameter(Position = 9, Mandatory = $false)]
[string]$scriptPath,
[Parameter(Position = 10, Mandatory = $false)]
[switch]$detailedDocs = $false,
[Parameter(Position = 11, Mandatory = $false)]
[switch]$notr = $false
)
# setting $scriptPath here, not as default argument, to support calling as "powershell -File psake.ps1"
if (-not $scriptPath) {
$scriptPath = $(Split-Path -Path $MyInvocation.MyCommand.path -Parent)
}
# '[p]sake' is the same as 'psake' but $Error is not polluted
Remove-Module -Name [p]sake -Verbose:$false
Import-Module -Name (Join-Path -Path $scriptPath -ChildPath 'psake.psd1') -Verbose:$false
if ($help) {
Get-Help -Name Invoke-psake -Full
return
}
if ($buildFile -and (-not (Test-Path -Path $buildFile))) {
$absoluteBuildFile = (Join-Path -Path $scriptPath -ChildPath $buildFile)
if (Test-path -Path $absoluteBuildFile) {
$buildFile = $absoluteBuildFile
}
}
Invoke-psake $buildFile $taskList $framework $docs $parameters $properties $initialization $nologo $detailedDocs $notr
if (!$psake.build_success) {
exit 1
}