Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running msdeploy.exe from within Powershell

I'm trying to run the following command from within Powershell:

msdeploy -verb:sync -source:archiveDir=c:\KitchenPC\Build -dest:appHostConfig="KitchenPC",computerName=https://192.168.0.3:8172/msdeploy.axd,authType=Basic,userName=someuser,password="secret" -allowUntrusted

The docs say to simply substitute the : after each parameter with an =. So I've tried this:

msdeploy -verb=sync -source=archiveDir=c:\KitchenPC\Build -dest=appHostConfig="KitchenPC",computerName=https://192.168.0.3:8172/msdeploy.axd,authType=Basic,userName=someuser,password="secret" -allowUntrusted

However, I get the error:

Error: Unrecognized argument 'computerName=https://192.168.0.3:8172/msdeploy.axd'. All arguments must begin with "-". Error count: 1.

I've checked the docs on provider settings, however they have no mention of their equivelent Powershell syntax.

like image 200
Mike Christensen Avatar asked Oct 20 '12 22:10

Mike Christensen


1 Answers

How do you call msdeploy from powershell when the parameters have spaces?

Think this is already answered, just modify it. Ex. include "KitchenPC" and "secret" using variables, and put the -dest part inside quotation marks.

Working Example:

msdeploy '-verb=sync' '-source=archiveDir=c:\KitchenPC\Build -dest=appHostConfig="KitchenPC",computerName=https://192.168.0.3:8172/msdeploy.axd,authType=Basic,userName=someuser,password="secret"' -allowUntrusted

(Note single quotes around each command line argument)

like image 151
Frode F. Avatar answered Oct 12 '22 00:10

Frode F.