我刚刚安装了psake 4.2.0版。
我把这个放到了default.ps1里
properties {
$message = "Task A executed"
}
task default -depends taskA
task taskA {
write-host $taskAmessage
}如果我运行Invoke-psake taskA,那么任务就会按预期执行。
当我不带任何参数执行Invoke-psake时,就像在introduction中一样,我得到以下错误:
Test-Path : Cannot bind argument to parameter 'Path' because it is an empty string.
At D:\animesh\software\utilities\psake-master\psake-master\psake.psm1:291 char:26
+ Assert (test-path <<<< $buildFile -pathType Leaf) ($msgs.error_build_file_not_found -f $buildFile)
+ CategoryInfo : InvalidData: (:) [Test-Path], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.PowerShell.Commands.TestPathCommand在我的Powershell配置文件中,我每次运行powershell时都会导入psake模块。
import-module "D:\animesh\software\utilities\psake-master\psake-master\psake.psm1"在项目页面中提出了此exact issue,但它似乎没有得到解决。我该如何解决这个问题?
发布于 2012-12-10 22:49:35
似乎模块代码有问题,您可能需要将psake.psm1的第269行修改为:
[Parameter(Position = 0, Mandatory = 0)][string] $buildFile=$psake.config_default.buildFileNamehttps://stackoverflow.com/questions/13796658
复制相似问题