Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 928135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:57:42+00:00 2026-05-15T19:57:42+00:00

Is it possible to split a PowerShell command line over multiple lines? In Visual

  • 0

Is it possible to split a PowerShell command line over multiple lines?

In Visual Basic I can use the underscore (_) to continue the command in the next line.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T19:57:42+00:00Added an answer on May 15, 2026 at 7:57 pm

    You can use a space followed by the grave accent (backtick):

    Get-ChildItem -Recurse `
      -Filter *.jpg `
      | Select LastWriteTime
    

    However, this is only ever necessary in such cases as shown above. Usually you get automatic line continuation when a command cannot syntactically be complete at that point. This includes starting a new pipeline element:

    Get-ChildItem |
      Select Name,Length
    

    will work without problems since after the | the command cannot be complete since it’s missing another pipeline element. Also opening curly braces or any other kind of parentheses will allow line continuation directly:

    $x=1..5
    $x[
      0,3
    ] | % {
      "Number: $_"
    }
    

    Similar to the | a comma will also work in some contexts:

    1,
    2
    

    Keep in mind, though, similar to JavaScript’s Automatic Semicolon Insertion, there are some things that are similarly broken because the line break occurs at a point where it is preceded by a valid statement:

    return
      5
    

    will not work.

    Finally, strings (in all varieties) may also extend beyond a single line:

    'Foo
    bar'
    

    They include the line breaks within the string, then.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to split a line in an R script over multiple lines (because
Is it possible to split a Clojure namespace over multiple source files when doing
Is it possible for a WPF Label to split itself automatically into several lines?
I know it is possible to split an array to be inserted to multiple
Possible Duplicate: Split string, convert ToList<int>() in one line… i have a string that
As shown below, Is it possible to split a Polygon by a Line? (into
Possible Duplicate: Split line with perl I have a line: regizor: Betty Thomas Distribuţia:
Is it possible to split up a single big legend into multiple (usually 2)
Possible Duplicate: Split a number into its digits with Haskell how can i convert
Is it possible to split a tag at lower to upper case boundaries i.e.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.