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

后端 未结 9 1246
忘了有多久
忘了有多久 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:40

    Found a working solution and easy fix. Reference: http://answered.site/all-arguments-must-begin-with--at-cwindowsdtldownloadswebserviceswebservicesidservicepublishedwebsitesidservicedeploymentidservicewsdeployps123/4231580/

    $msdeploy = "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe"
    $msdeployArgs = @(
    "-verb:sync",
    "-source:iisApp='Default Web Site/HelloWorld'",
    "-verbose",
    "-dest:archiveDir='c:\temp1'"
    )
    Start-Process $msdeploy -NoNewWindow -ArgumentList $msdeployArgs
    

提交回复
热议问题