Exec failing when there are spaces in parameters

167 views
Skip to first unread message

ER

unread,
Aug 8, 2012, 4:07:54 AM8/8/12
to psake...@googlegroups.com
Hi Guys

I am trying to use Exec to run msdeploy and having some issues. One of the parameters -source: has spaces in its value i.e.
Exec { $msdeploy -verb:sync -source:package=$package -dest:dest}

$package may have spaces in the path like c:\some data\package files\

How do I handle this?

Jason Jarrett

unread,
Aug 8, 2012, 2:20:59 PM8/8/12
to psake...@googlegroups.com
You might give one of the following a try...

       Exec { $msdeploy -verb:sync -source:package="$package" -dest:dest} 

The above sometimes doesn't work (haven't figured out when/why it does/doesn't)

Or

       Exec { $msdeploy -verb:sync "-source:package=$package" -dest:dest} 

It's just a guess, but hope one of these might help.



--
You received this message because you are subscribed to the Google Groups "psake-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/psake-users/-/xWg3zlCUUPgJ.
To post to this group, send email to psake...@googlegroups.com.
To unsubscribe from this group, send email to psake-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/psake-users?hl=en.


Peter Seale

unread,
Aug 8, 2012, 2:30:21 PM8/8/12
to psake...@googlegroups.com
PowerShell's command-line support is brutal, as you are discovering. Thankfully the PowerShell Community Extensions features a "echoargs" utility which will help you troubleshoot your problem.

Install PSCX on your machine and run:

Exec { echoargs $msdeploy -verb:sync "-source:package=$package" -dest:dest}  

...and see what echoargs outputs. I think you want to see the entirety of  -source:package="$package" as one argument, WITH quotes included. Keep tweaking the placement of your quotes until it works.

My first guess is

Exec { $msdeploy -verb:sync "-source:package=""$package""" -dest:dest} 

Jorge Matos

unread,
Aug 9, 2012, 12:54:21 AM8/9/12
to psake...@googlegroups.com

try wrapping it with double quotes

Reply all
Reply to author
Forward
0 new messages