Created
June 10, 2016 15:04
-
-
Save vcaraulean/6d63253e8eb933f41bbd44ea7297793d to your computer and use it in GitHub Desktop.
psake - passing in parameters
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
$scriptPath = $MyInvocation.MyCommand.Path | |
$scriptDir = Split-Path $scriptPath | |
Get-Module psake | Remove-Module | |
Import-Module ("C:\Dev\Tools\psake.4.6.0\tools\psake.psm1") | |
$envProperties = @{ | |
"starterParam1"="start param value" | |
"starterParam2"= | |
"start param 2 value", ` | |
"sadkjsahd", ` | |
"item3" | |
} | |
invoke-psake $scriptDir\tasks.ps1 -properties $envProperties |
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
properties { | |
$localTaskValue = " -- local -- " | |
$starterParam1 = $null | |
$starterParam2 = $null | |
} | |
task default -Depends Task1 | |
task Task1 { | |
"..discovered parameters.." | |
Write-Host $psake.context.Peek().properties | |
"..individual params.." | |
Write-Host "starterParam1: $starterParam1" | |
Write-Host "starterParam2: $starterParam2" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment