Please feel free to provide feedback or file bugs here.

Allow whitespace between final newline and quotation mark in here-string

Votes from Connect: 10

Original Date Submitted: 12/10/2011 12:21:15 AM

********Contact Information********
Handle: JoshGav
Site Name: PowerShell
Feedback ID: 712796

Frequency: Always Happens
Regression: Yes, this happens in previous released versions

Problem Description:
The final delimiter in a here-string is defined as newline-quotemarks-atsign. This means that the "@ has to be at the beginning of the final line, with no whitespace preceding it. This ruins attempts at tab indentation in scripts and functions. Whitespace should be allowed as part of the ending pattern between the newline and quotemarks so that tab indentation can be cleanly utilized.

Product Studio item created by Connect Synchronizer due to creation of feedback ID 712796 (

Repro Steps:
If a here-string is typed as follows:
$str = @"
a string
it will not be evaluated properly.

Expected Results:
Allow the previously indicated string as a here-string, ignoring the extra whitespace between the final newline and ".

Internal BugId: 3186

14 votes
Sign in
Password icon
Signed in as (Sign out)

We’ll send you updates on this idea

AdminJoey Aiello [MSFT] (Program Manager, Windows Server) shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →


Sign in
Password icon
Signed in as (Sign out)

Feedback and Knowledge Base