CruiseControl.Net doesn't play well with PowerShell

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 in 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 the scripts. There is a space in the name of the β€œProgram Files” disc.
If I try to put "around" or "around it", then cruisecontrol indicates an invalid drive. Any help would be awesome.

PowerShell Version - V2

CruiseControl.Net Version - 1.5.6755.1

+3
source share
2 answers

8 . dir/x, . , . c:\PROGRA ~ 1\CRUISE ~ 1...

+4

, ( " XML?), , , , powershell:

mklink /D c:\powershell "C:\WINDOWS\system32\WindowsPowerShell\v1.0"

<script>RunScout3G.ps1</script>
<executable>C:\powershell\PowerShell.exe</executable>

btw, Powershell V2, ?

0

Source: https://habr.com/ru/post/1758023/


All Articles