2012-12-10 52 views
1

我刚安装了psake 4.2.0版。执行无参数Invoke-psake时出错

我把这个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配置文件,我导入psake模块每次我运行PowerShell的。

import-module "D:\animesh\software\utilities\psake-master\psake-master\psake.psm1" 

有此exact issue项目页提出,但它似乎没有解决。我该如何解决?

回答

1

似乎出了点问题与模块代码,您可能需要psake.psm1线269修改为:

[Parameter(Position = 0, Mandatory = 0)][string] $buildFile=$psake.config_default.buildFileName 
+0

我会尽量今晚,将让你知道它的工作。 – Animesh