我有一个简单的 psake 脚本:
properties {
$SolutionDir = "SOLUTIONDIR" # Resolve-Path ".\src"
$Config = "Debug"
$DeployBaseDir = "$SolutionDir\RMSS.Setup.WiX\bin\$Config"
$InstallerName = "RMSForMoversSuite_2_0_0"
}
task default -depends Test
task Test {
"CONFIG = $Config"
"SOLUTIONDIR = $SolutionDir"
"DEPLOYBASEDIR = $DeployBaseDir"
}
我从命令行调用它,如下所示:
& .\psake.ps1 .\deploy.ps1 -properties @{"Config"="Staging"}
我希望$DeployBaseDir
等于SOLUTIONDIR\RMSS.Setup.WiX\bin\Staging
但相反,我得到了这个输出:
CONFIG = Staging
SOLUTIONDIR = SOLUTIONDIR
DEPLOYBASEDIR = SOLUTIONDIR\RMSS.Setup.WiX\bin\Debug
谁能告诉我发生了什么,为什么以及如何获得我期望的行为?