以下是我的 PowerScript 任务
<powershell>
<script>RunScout3G.ps1</script>
<executable>C:\WINDOWS\system32\WindowsPowerShell\v1.0\PowerShell.exe</executable>
<scriptsDirectory>C:\Program Files\CruiseControl.NET\Our_PowerShell</scriptsDirectory>
<buildArgs></buildArgs>
<successExitCodes>0</successExitCodes>
<buildTimeoutSeconds>900</buildTimeoutSeconds>
<description>Example of how to run a PowerShell script.</description>
</powershell>
错误是这样的...
<buildresults>
<message level="Error">The term 'C:\Program' is not recognized as the name of a cmdlet, function, scri </message>
<message level="Error">pt file, or operable program. Check the spelling of the name, or if a path was </message>
<message level="Error">included, verify that the path is correct and try again.</message>
<message level="Error">At line:1 char:11 </message>
<message level="Error">+ C:\Program <<<< Files\CruiseControl.NET\JCDC_PowerShell\RunScout3G.ps1 </message>
<message level="Error"> + CategoryInfo : ObjectNotFound: (C:\Program:String) [], CommandN </message>
<message level="Error"> otFoundException </message>
<message level="Error"> + FullyQualifiedErrorId : CommandNotFoundException </message>
<message level="Error"> </message>
问题出在scriptsDirectory。驱动器名称“Program Files”中有一个空格。
如果我尝试在它周围加上'或",cruisecontrol会显示无效驱动器。
任何帮助都将是非常棒的。
PowerShell版本为V2
CruiseControl.Net版本为1.5.6755.1