Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
413 views
in Technique[技术] by (71.8m points)

How to split long commands over multiple lines in PowerShell

How do you take a command like the following in PowerShell and split it across multiple lines?

&"C:Program FilesIISMicrosoft Web Deploymsdeploy.exe" -verb:sync -source:contentPath="c:workspacexxxmasterBuild\_PublishedWebsitesxxx.Web" -dest:contentPath="c:websitesxxxwwwroot,computerName=192.168.1.1,username=administrator,password=xxx"
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Trailing backtick character, i.e.,

&"C:Program FilesIISMicrosoft Web Deploymsdeploy.exe" `
-verb:sync `
-source:contentPath="c:workspacexxxmasterBuild\_PublishedWebsitesxxx.Web" `
-dest:contentPath="c:websitesxxxwwwroot,computerName=192.168.1.1,username=administrator,password=xxx"

White space matters. The required format is Space`Enter.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...