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

后端 未结 9 1261
忘了有多久
忘了有多久 2020-11-30 05:52

I\'m running into a problem with spaces in my parameters that I try to send into msdeploy from a powershell script.

There are a number of other related articles but

9条回答
  •  野性不改
    2020-11-30 06:39

    Just adding another way in case it is helpful to anyone:

    Invoke-Expression "& '[path to msdeploy]\msdeploy.exe' --% -verb:sync -source:contentPath=`'$source`' -dest:contentPath=`'$dest`'"
    

    "--%" is new to powershell 3. From here: "You simply add a the --% sequence (two dashes and a percent sign) anywhere in the command line and PowerShell will not try to parse the remainder of that line."

提交回复
热议问题