diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md index b7214a3ea5a7..16f51da7fa97 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md @@ -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 @@ -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 @@ -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 `` @@ -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 @" diff --git a/reference/7.0/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md b/reference/7.0/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md index 401e1e4e4ffc..fb4d655588be 100644 --- a/reference/7.0/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md +++ b/reference/7.0/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md @@ -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 @@ -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 @@ -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 `` @@ -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 @" diff --git a/reference/7.1/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md b/reference/7.1/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md index 6e28b8921dca..0d33acb729e6 100644 --- a/reference/7.1/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md +++ b/reference/7.1/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md @@ -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 @@ -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 @@ -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 `` @@ -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 @" diff --git a/reference/7.2/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md b/reference/7.2/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md index bbcd750a0f36..8aad7e1d1642 100644 --- a/reference/7.2/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md +++ b/reference/7.2/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md @@ -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 @@ -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 @@ -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 `` @@ -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 @" diff --git a/reference/7.3/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md b/reference/7.3/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md index 7e569ee4212d..ed56981ae422 100644 --- a/reference/7.3/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md +++ b/reference/7.3/Microsoft.PowerShell.Core/About/about_Quoting_Rules.md @@ -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 @@ -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 @@ -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 `` @@ -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 @"