6

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.

1

1 Answer 1

5

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)

Sign up to request clarification or add additional context in comments.

3 Comments

Yea, I read that post already. They weren't using any provider settings, so it doesn't really apply. The solution in the blog post was basically writing a function that spawns cmd.exe which might be the best solution. That's too bad.
Oh I see what you're saying. this post helped me figure it out, and I've updated a working example to your answer.
Fantastic! So many other blog posts and responses say it's not possible or recommend kludges such as calling cmd or start-process.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.