如何在 PowerShell 中获取如下所示的命令并将其拆分为多行?
&"C:\Program Files\IIS\Microsoft Web Deploy\msdeploy.exe" -verb:sync -source:contentPath="c:\workspace\xxx\master\Build\_PublishedWebsites\xxx.Web" -dest:contentPath="c:\websites\xxx\wwwroot\,computerName=192.168.1.1,username=administrator,password=xxx"
最佳答案
尾随反引号字符,即,
&"C:\Program Files\IIS\Microsoft Web Deploy\msdeploy.exe" `
-verb:sync `
-source:contentPath="c:\workspace\xxx\master\Build\_PublishedWebsites\xxx.Web" `
-dest:contentPath="c:\websites\xxx\wwwroot,computerName=192.168.1.1,username=administrator,password=xxx"
空白很重要。所需格式为空格`Enter。
关于powershell - 如何在 PowerShell 中将长命令拆分为多行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2608144/