-
-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed issue with psake.ps1 failing when passing named parameters.
- Loading branch information
1 parent
21d7cd5
commit 64ea235
Showing
1 changed file
with
24 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,28 @@ | ||
# Helper script for those who want to run psake without importing the module. | ||
# Example: | ||
# .\psake.ps1 "default.ps1" "BuildHelloWord" "4.0" | ||
# | ||
try | ||
{ | ||
$scriptPath = Split-Path -parent $MyInvocation.InvocationName; | ||
import-module (join-path $scriptPath psake.psm1) | ||
invoke-psake @args | ||
} | ||
finally | ||
{ | ||
remove-module psake -ea "SilentlyContinue" | ||
|
||
# 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 = '3.5', | ||
[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 = @{} | ||
) | ||
|
||
try { | ||
$scriptPath = Split-Path -parent $MyInvocation.InvocationName; | ||
import-module (join-path $scriptPath psake.psm1) | ||
invoke-psake $buildFile $taskList $framework $docs $parameters $properties | ||
} finally { | ||
remove-module psake -ea "SilentlyContinue" | ||
} |