PowerShell で長いコマンドを複数行に分割する方法 質問する

PowerShell で長いコマンドを複数行に分割する方法 質問する

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"

ベストアンサー1

末尾のバックティック文字、すなわち、

&"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"

空白は重要です。必要な形式は ですSpace`Enter

おすすめ記事