tags:

views:

26

answers:

1

Hi,

I've been trying to run the following command line from a Powershell build script we have; but keep running into issues

& 'C:\Dev\Yadda\trunk\BuildScripts\U tilities\csmanage.exe' `
  /create-deployment `
  /name:yadddayaddyaddadev `
  /label:yadddayaddyaddadev `
  /package:https://yadddayaddyadda.blob.core.windows.net/mydeployments/20100426_202848_FamilyMoments.cspkg `
  /config:C:\Dev\WalmartOne\trunk\yadddayaddyadda.CloudService\bin\Debug\ServiceConfiguration.cscfg `
  /slot:Staging `
  /hosted-service:yadddayaddyadda-dev"

Note: the space in "Utilities" is intentional; trying to snif out a bug involving spaces in the executable path. I assure you, the path does exist with the space in it on my machine.

What's the best way to call this command line from Powershell? I've tried Invoke-Expression, Diagnostic.Process::Start, &; each method coming up with some different type of error; usually that it could find the executable. Any constructive input is greatly appreciated.

Thanks.

+1  A: 

Once I removed the trailing spaces after the ` line continuation characters and got rid of the very last double-quote, it seems to work for me (on PowerShell 2.0). Watch out for trailing spaces after line continuation chars - PowerShell really doesn't like that. Note that I don't have your utility so I'm using a debug utility from the PowerShell Community Extensions that just echos arguments back to the screen:

PS> C:\Windows\system32>echoargs.exe `
  /create-deployment `
  /name:yadddayaddyaddadev `
  /label:yadddayaddyaddadev `
  /package:https://yadddayaddyadda.blob.core.windows.net/mydeployments/20100426_202848_FamilyMoments.cspkg `
  /config:C:\Dev\WalmartOne\trunk\yadddayaddyadda.CloudService\bin\Debug\ServiceConfiguration.cscfg `
  /slot:Staging `
  /hosted-service:yadddayaddyadda-dev
Arg 0 is </create-deployment>
Arg 1 is </name:yadddayaddyaddadev>
Arg 2 is </label:yadddayaddyaddadev>
Arg 3 is </package:https://yadddayaddyadda.blob.core.windows.net/mydeployments/20100426_202848_FamilyMoments.cspkg&gt;
Arg 4 is </config:C:\Dev\WalmartOne\trunk\yadddayaddyadda.CloudService\bin\Debug\ServiceConfiguration.cscfg>
Arg 5 is </slot:Staging>
Arg 6 is </hosted-service:yadddayaddyadda-dev>

Note that the space in 'U tilies' shouldn't be a problem. You have quoted the path and are using the call operator & correctly. If you remove all your parameters, does the exe invoke (even if it only spits out usage)? If it does, then I suspect a problem with feeding it the arguments which is somewhat common problem when calling exes from PowerShell.

Keith Hill