forked from psake/psake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
psake.ps1
51 lines (46 loc) · 1.8 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
# Helper script for those who want to run psake without importing the module.
# Example:
# .\psake.ps1 "default.ps1" "BuildHelloWord" "4.0"
# Must match parameter definitions for psake.psm1/invoke-psake
# otherwise named parameter binding fails
param(
[Parameter(Position=0,Mandatory=0)]
[string]$buildFile = 'default.ps1',
[Parameter(Position=1,Mandatory=0)]
[string[]]$taskList = @(),
[Parameter(Position=2,Mandatory=0)]
[string]$framework,
[Parameter(Position=3,Mandatory=0)]
[switch]$docs = $false,
[Parameter(Position=4,Mandatory=0)]
[System.Collections.Hashtable]$parameters = @{},
[Parameter(Position=5, Mandatory=0)]
[System.Collections.Hashtable]$properties = @{},
[Parameter(Position=6, Mandatory=0)]
[alias("init")]
[scriptblock]$initialization = {},
[Parameter(Position=7, Mandatory=0)]
[switch]$nologo = $false,
[Parameter(Position=8, Mandatory=0)]
[switch]$help = $false,
[Parameter(Position=9, Mandatory=0)]
[string]$scriptPath = $(Split-Path -parent $MyInvocation.MyCommand.path)
)
$currentThread = [System.Threading.Thread]::CurrentThread
$invariantCulture = [System.Globalization.CultureInfo]::InvariantCulture
$currentThread.CurrentCulture = $invariantCulture
$currentThread.CurrentUICulture = $invariantCulture
# '[p]sake' is the same as 'psake' but $Error is not polluted
remove-module [p]sake
import-module (join-path $scriptPath psake.psm1)
if ($help) {
Get-Help Invoke-psake -full
return
}
if (-not(test-path $buildFile)) {
$absoluteBuildFile = (join-path $scriptPath $buildFile)
if (test-path $absoluteBuildFile) {
$buildFile = $absoluteBuildFile
}
}
invoke-psake $buildFile $taskList $framework $docs $parameters $properties $initialization $nologo