Here is my PowerScript Task
<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>
The Error is this...
<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>
The problem is with scriptsDirectory. There is a space in the drive name "Program Files".
If I try and put ' around it, or " around it cruisecontrol says invalid drive.
Any help would be awesome.
Version of PowerShell is V2
Version of CruiseControl.Net is 1.5.6755.1
You could also try using the 8 character directory names. If you run dir /x you will see the shortened names. They will never have any spaces in them, so it's a nice way to avoid the escaped character issues. In your case it should look like c:\PROGRA~1\CRUISE~1...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With