Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: Describes rules for using single and double quotation marks in PowerShell.
Locale: en-US
ms.date: 04/26/2022
ms.date: 05/03/2022
online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_quoting_rules?view=powershell-5.1&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about Quoting Rules
Expand Down Expand Up @@ -201,10 +201,16 @@ Use a quotation mark (`") to begin a string.

The quotation rules for here-strings are slightly different.

A here-string is a single-quoted or double-quoted string in which quotation
marks are interpreted literally. A here-string can span multiple lines. All the
lines in a here-string are interpreted as strings even though they are not
enclosed in quotation marks.
A here-string is a single-quoted or double-quoted string surrounded by at signs
(`@`). Quotation marks within a here-string are interpreted literally.

A here-string:

- spans multiple lines
- begins with the opening mark followed by a newline
- ends with a newline followed by the closing mark
- includes every line between the opening and closing marks as part of a single
string

Like regular strings, variables are replaced by their values in double-quoted
here-strings. In single-quoted here-strings, variables are not replaced by
Expand All @@ -214,7 +220,7 @@ You can use here-strings for any text, but they are particularly useful for
the following kinds of text:

- Text that contains literal quotation marks
- Multiple lines of text, such as the text in an HTML or XML
- Multiple lines of text, such as the text in an HTML or XML block
- The Help text for a script or function document

A here-string can have either of the following formats, where `<Enter>`
Expand All @@ -237,11 +243,12 @@ Single-quotes:
'@
```

In either format, the closing quotation mark must be the first character in
the line.
> [!NOTE]
> The final newline character is part of the closing mark. It is not added to
> the here-string.

A here-string contains all the text between the two hidden characters. In the
here-string, all quotation marks are interpreted literally. For example:
A here-string contains all the text between the opening and closing marks. In
the here-string, all quotation marks are interpreted literally. For example:

```powershell
@"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: Describes rules for using single and double quotation marks in PowerShell.
Locale: en-US
ms.date: 04/26/2022
ms.date: 05/03/2022
online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_quoting_rules?view=powershell-7&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about Quoting Rules
Expand Down Expand Up @@ -201,10 +201,16 @@ Use a quotation mark (`") to begin a string.

The quotation rules for here-strings are slightly different.

A here-string is a single-quoted or double-quoted string in which quotation
marks are interpreted literally. A here-string can span multiple lines. All the
lines in a here-string are interpreted as strings even though they are not
enclosed in quotation marks.
A here-string is a single-quoted or double-quoted string surrounded by at signs
(`@`). Quotation marks within a here-string are interpreted literally.

A here-string:

- spans multiple lines
- begins with the opening mark followed by a newline
- ends with a newline followed by the closing mark
- includes every line between the opening and closing marks as part of a single
string

Like regular strings, variables are replaced by their values in double-quoted
here-strings. In single-quoted here-strings, variables are not replaced by
Expand All @@ -214,7 +220,7 @@ You can use here-strings for any text, but they are particularly useful for
the following kinds of text:

- Text that contains literal quotation marks
- Multiple lines of text, such as the text in an HTML or XML
- Multiple lines of text, such as the text in an HTML or XML block
- The Help text for a script or function document

A here-string can have either of the following formats, where `<Enter>`
Expand All @@ -237,11 +243,12 @@ Single-quotes:
'@
```

In either format, the closing quotation mark must be the first character in
the line.
> [!NOTE]
> The final newline character is part of the closing mark. It is not added to
> the here-string.

A here-string contains all the text between the two hidden characters. In the
here-string, all quotation marks are interpreted literally. For example:
A here-string contains all the text between the opening and closing marks. In
the here-string, all quotation marks are interpreted literally. For example:

```powershell
@"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: Describes rules for using single and double quotation marks in PowerShell.
Locale: en-US
ms.date: 04/26/2022
ms.date: 05/03/2022
online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_quoting_rules?view=powershell-7.1&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about Quoting Rules
Expand Down Expand Up @@ -201,10 +201,16 @@ Use a quotation mark (`") to begin a string.

The quotation rules for here-strings are slightly different.

A here-string is a single-quoted or double-quoted string in which quotation
marks are interpreted literally. A here-string can span multiple lines. All the
lines in a here-string are interpreted as strings even though they are not
enclosed in quotation marks.
A here-string is a single-quoted or double-quoted string surrounded by at signs
(`@`). Quotation marks within a here-string are interpreted literally.

A here-string:

- spans multiple lines
- begins with the opening mark followed by a newline
- ends with a newline followed by the closing mark
- includes every line between the opening and closing marks as part of a single
string

Like regular strings, variables are replaced by their values in double-quoted
here-strings. In single-quoted here-strings, variables are not replaced by
Expand All @@ -214,7 +220,7 @@ You can use here-strings for any text, but they are particularly useful for
the following kinds of text:

- Text that contains literal quotation marks
- Multiple lines of text, such as the text in an HTML or XML
- Multiple lines of text, such as the text in an HTML or XML block
- The Help text for a script or function document

A here-string can have either of the following formats, where `<Enter>`
Expand All @@ -237,11 +243,12 @@ Single-quotes:
'@
```

In either format, the closing quotation mark must be the first character in
the line.
> [!NOTE]
> The final newline character is part of the closing mark. It is not added to
> the here-string.

A here-string contains all the text between the two hidden characters. In the
here-string, all quotation marks are interpreted literally. For example:
A here-string contains all the text between the opening and closing marks. In
the here-string, all quotation marks are interpreted literally. For example:

```powershell
@"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: Describes rules for using single and double quotation marks in PowerShell.
Locale: en-US
ms.date: 04/26/2022
ms.date: 05/03/2022
online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_quoting_rules?view=powershell-7.2&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about Quoting Rules
Expand Down Expand Up @@ -201,10 +201,16 @@ Use a quotation mark (`") to begin a string.

The quotation rules for here-strings are slightly different.

A here-string is a single-quoted or double-quoted string in which quotation
marks are interpreted literally. A here-string can span multiple lines. All the
lines in a here-string are interpreted as strings even though they are not
enclosed in quotation marks.
A here-string is a single-quoted or double-quoted string surrounded by at signs
(`@`). Quotation marks within a here-string are interpreted literally.

A here-string:

- spans multiple lines
- begins with the opening mark followed by a newline
- ends with a newline followed by the closing mark
- includes every line between the opening and closing marks as part of a single
string

Like regular strings, variables are replaced by their values in double-quoted
here-strings. In single-quoted here-strings, variables are not replaced by
Expand All @@ -214,7 +220,7 @@ You can use here-strings for any text, but they are particularly useful for
the following kinds of text:

- Text that contains literal quotation marks
- Multiple lines of text, such as the text in an HTML or XML
- Multiple lines of text, such as the text in an HTML or XML block
- The Help text for a script or function document

A here-string can have either of the following formats, where `<Enter>`
Expand All @@ -237,11 +243,12 @@ Single-quotes:
'@
```

In either format, the closing quotation mark must be the first character in
the line.
> [!NOTE]
> The final newline character is part of the closing mark. It is not added to
> the here-string.

A here-string contains all the text between the two hidden characters. In the
here-string, all quotation marks are interpreted literally. For example:
A here-string contains all the text between the opening and closing marks. In
the here-string, all quotation marks are interpreted literally. For example:

```powershell
@"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: Describes rules for using single and double quotation marks in PowerShell.
Locale: en-US
ms.date: 04/26/2022
ms.date: 05/03/2022
online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_quoting_rules?view=powershell-7.3&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about Quoting Rules
Expand Down Expand Up @@ -201,10 +201,16 @@ Use a quotation mark (`") to begin a string.

The quotation rules for here-strings are slightly different.

A here-string is a single-quoted or double-quoted string in which quotation
marks are interpreted literally. A here-string can span multiple lines. All the
lines in a here-string are interpreted as strings even though they are not
enclosed in quotation marks.
A here-string is a single-quoted or double-quoted string surrounded by at signs
(`@`). Quotation marks within a here-string are interpreted literally.

A here-string:

- spans multiple lines
- begins with the opening mark followed by a newline
- ends with a newline followed by the closing mark
- includes every line between the opening and closing marks as part of a single
string

Like regular strings, variables are replaced by their values in double-quoted
here-strings. In single-quoted here-strings, variables are not replaced by
Expand All @@ -214,7 +220,7 @@ You can use here-strings for any text, but they are particularly useful for
the following kinds of text:

- Text that contains literal quotation marks
- Multiple lines of text, such as the text in an HTML or XML
- Multiple lines of text, such as the text in an HTML or XML block
- The Help text for a script or function document

A here-string can have either of the following formats, where `<Enter>`
Expand All @@ -237,11 +243,12 @@ Single-quotes:
'@
```

In either format, the closing quotation mark must be the first character in
the line.
> [!NOTE]
> The final newline character is part of the closing mark. It is not added to
> the here-string.

A here-string contains all the text between the two hidden characters. In the
here-string, all quotation marks are interpreted literally. For example:
A here-string contains all the text between the opening and closing marks. In
the here-string, all quotation marks are interpreted literally. For example:

```powershell
@"
Expand Down