6

我正在尝试从 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

文档说只需将每个参数的after:替换为=. 所以我试过这个:

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

但是,我收到错误:

错误:无法识别的参数“computerName=https://192.168.0.3:8172/msdeploy.axd”。所有参数必须以“-”开头。错误计数:1。

我已经检查了有关 provider settings 的文档,但是他们没有提到它们等效的 Powershell 语法。

4

1 回答 1

5

当参数有空格时,如何从 powershell 调用 msdeploy?

认为这已经回答了,只需修改它。前任。使用变量包括“KitchenPC”和“secret”,并将 -dest 部分放在引号内。

工作示例:

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

(注意每个命令行参数周围的单引号)

于 2012-10-20T22:42:36.720 回答