I have the following psake script
properties {
$ApplicationName = "test"
$ApplicationPath = "c:\this\is\$ApplicationName"
}
Task test {
"ApplicationName = $ApplicationName"
"ApplicationPath = $ApplicationPath"
}
I want to pass only the ApplicationName to the script, in order to avoid typing the whole application path. But when i use the -parameters
flag no change is applied to the properties
Invoke-psake .\script.ps1 -parameters @{ApplicationName = "another_test"} test
ApplicationName = test
ApplicationPath = c:\this\is\test
Which doesn't sound right since parameters should be evaluated before any property block. When i use the -properties
flag the application name is changed, but not the path
Invoke-psake .\script.ps1 -properties @{ApplicationName = "another_test"} test
ApplicationName = another_test
ApplicationPath = c:\this\is\test
So the properties have already been initialized, but shouldn't the -parameters
override this behavior?