Movatterモバイル変換


[0]ホーム

URL:


Sorry, we no longer support your browser
Please upgrade toMicrosoft Edge,Google Chrome, orFirefox. Learn more about ourbrowser support.
Skip to main content
Stack Overflow
  1. About
  2. For Teams
Loading…
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Timeline forHow to split long commands over multiple lines in PowerShell

Current License: CC BY-SA 4.0

12 events
when toggle formatwhatbylicensecomment
Mar 23, 2023 at 14:28commentadded andowero backtick is not really a good practice, since any invisible character after it breaks the code
Feb 16, 2023 at 12:54commentadded muzimuzhi Z For curious like me: Powershell's official doc, page about_Parsing, secLine Continuationlearn.microsoft.com/en-us/powershell/module/… .
Feb 3, 2021 at 7:47commentadded Chris Smith You can also split the strings over multiple lines with the subexpression and arithmetic operators $() and +. e.g. -dest:contentPath=$("c:\websites\xxx\wwwroot," + "computerName=192.168.1.1" + ...). A new line can follow each +.
Jan 27, 2020 at 14:58historyeditedMyrddin EmrysCC BY-SA 4.0
Added important restrictions only available in the comments.
Feb 25, 2019 at 22:55commentadded mjd2 Backticks are brittle (as above comments state) and hard to find when parsing or reviewing a file. @StevenPenny 's answer is better if you want easier to debug code.
Aug 24, 2018 at 19:16historyeditedPeter MortensenCC BY-SA 4.0
Active reading.
Nov 21, 2016 at 23:35commentadded RayLuo @josh-graham And there should NOT be any space (or inline comment) AFTER the back-tick. #learned-the-hard-way
Feb 15, 2016 at 14:40commentadded Josh Graham The space in front of the back-tick is required #learned-the-hard-way
Oct 6, 2013 at 23:06commentadded x0n If you're running powershell 3 or higher, see github.com/lzybkr/psreadline - history traversal is fixed for multiline statements.
Feb 6, 2013 at 12:16commentadded Richard Ev This seems to break command history (up arrow) functionality; as each line shows up as a separate command. Is there a way around this?
Apr 9, 2010 at 14:51voteacceptasgerhallas
Apr 9, 2010 at 14:17history answeredColin PickardCC BY-SA 2.5

[8]ページ先頭

©2009-2025 Movatter.jp