Running msdeploy.exe from inside Powershell

I am trying to run the following command from 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 

docs say to simply replace : after each parameter = . So I 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 message:

Error: Unrecognized argument 'ComputerName = https://192.168.0.3: 8172 / msdeploy.axd. All arguments must begin with a "-". Number of errors: 1.

I checked the documents in the provider settings , however, they have no mention of their equivalent Powershell syntax.

+4
source share
1 answer

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

Think it already answered, just change it. Ex. include "KitchenPC" and "secretly" using variables and place the -dest part inside quotes.

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 the single quotes around each command line argument)

+3
source

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


All Articles