From ecde2a2fd9d7f37cc4e2aebbde6dd971d68cf9e7 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Wed, 11 Mar 2026 08:56:38 -0500 Subject: [PATCH] Fix accuracy of the output in examples --- .../Get-Content.md | 30 ++++++++++--------- .../Get-Content.md | 20 ++++++------- .../Get-Content.md | 20 ++++++------- .../Get-Content.md | 20 ++++++------- 4 files changed, 46 insertions(+), 44 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Management/Get-Content.md b/reference/5.1/Microsoft.PowerShell.Management/Get-Content.md index 52bd66fab58e..282f4a6338be 100644 --- a/reference/5.1/Microsoft.PowerShell.Management/Get-Content.md +++ b/reference/5.1/Microsoft.PowerShell.Management/Get-Content.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 01/18/2026 +ms.date: 03/11/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/get-content?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -58,8 +58,8 @@ Get-Content -Path .\LineNumbers.txt ``` ```Output -This is Line 1 -This is Line 2 +This is line 1. +This is line 2. ... This is line 99. This is line 100. @@ -81,11 +81,11 @@ Get-Content -Path .\LineNumbers.txt -TotalCount 5 ``` ```Output -This is Line 1 -This is Line 2 -This is Line 3 -This is Line 4 -This is Line 5 +This is line 1. +This is line 2. +This is line 3. +This is line 4. +This is line 5. ``` ### Example 3: Get a specific line of content from a text file @@ -99,7 +99,7 @@ that content. The **TotalCount** parameter gets the first 25 lines of content. T ``` ```Output -This is Line 25 +This is line 25. ``` The `Get-Content` command is wrapped in parentheses so that the command completes before going to @@ -117,7 +117,7 @@ Get-Item -Path .\LineNumbers.txt | Get-Content -Tail 1 ``` ```Output -This is Line 100 +This is line 100. ``` This example uses the `Get-Item` cmdlet to demonstrate that you can pipe files to `Get-Content`. The @@ -132,7 +132,8 @@ to create sample content in a file named `Stream.txt`. ```powershell Set-Content -Path .\Stream.txt -Value 'This is the content of the Stream.txt file' -# Specify a wildcard to the Stream parameter to display all streams of the recently created file. +# Specify a wildcard to the Stream parameter to display all streams of the recently +# created file. Get-Item -Path .\Stream.txt -Stream * ``` @@ -171,7 +172,8 @@ This is the content of the Stream.txt file ``` ```powershell -# Use the Stream parameter of Add-Content to create a new Stream containing sample content. +# Use the Stream parameter of Add-Content to create a new Stream containing sample +# content. $addContentSplat = @{ Path = '.\Stream.txt' Stream = 'NewStream' @@ -215,7 +217,7 @@ Added a stream named NewStream to Stream.txt ``` The **Stream** parameter is a dynamic parameter of the -[FileSystem provider](../microsoft.powershell.core/about/about_filesystem_provider.md#stream-string). +[FileSystem provider](../Microsoft.PowerShell.Core/About/about_FileSystem_Provider.md#stream-string). By default `Get-Content` only retrieves data from the default, or `:$DATA` stream. **Streams** can be used to store hidden data such as attributes, security settings, or other data. They can also be stored on directories without being child items. @@ -457,7 +459,7 @@ it in single quotation marks. Single quotation marks tell PowerShell not to inte as escape sequences. For more information, see -[about_Quoting_Rules](../Microsoft.Powershell.Core/About/about_Quoting_Rules.md). +[about_Quoting_Rules](../Microsoft.PowerShell.Core/About/about_Quoting_Rules.md). ```yaml Type: System.String[] diff --git a/reference/7.4/Microsoft.PowerShell.Management/Get-Content.md b/reference/7.4/Microsoft.PowerShell.Management/Get-Content.md index cac3ab60a556..bcc647c4551f 100644 --- a/reference/7.4/Microsoft.PowerShell.Management/Get-Content.md +++ b/reference/7.4/Microsoft.PowerShell.Management/Get-Content.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 01/18/2026 +ms.date: 03/11/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/get-content?view=powershell-7.4&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -60,8 +60,8 @@ Get-Content -Path .\LineNumbers.txt ``` ```Output -This is Line 1 -This is Line 2 +This is line 1. +This is line 2. ... This is line 99. This is line 100. @@ -83,11 +83,11 @@ Get-Content -Path .\LineNumbers.txt -TotalCount 5 ``` ```Output -This is Line 1 -This is Line 2 -This is Line 3 -This is Line 4 -This is Line 5 +This is line 1. +This is line 2. +This is line 3. +This is line 4. +This is line 5. ``` ### Example 3: Get a specific line of content from a text file @@ -101,7 +101,7 @@ that content. The **TotalCount** parameter gets the first 25 lines of content. T ``` ```Output -This is Line 25 +This is line 25. ``` The `Get-Content` command is wrapped in parentheses so that the command completes before going to @@ -119,7 +119,7 @@ Get-Item -Path .\LineNumbers.txt | Get-Content -Tail 1 ``` ```Output -This is Line 100 +This is line 100. ``` This example uses the `Get-Item` cmdlet to demonstrate that you can pipe files to `Get-Content`. The diff --git a/reference/7.5/Microsoft.PowerShell.Management/Get-Content.md b/reference/7.5/Microsoft.PowerShell.Management/Get-Content.md index 27f30b59972c..d4ec09d99201 100644 --- a/reference/7.5/Microsoft.PowerShell.Management/Get-Content.md +++ b/reference/7.5/Microsoft.PowerShell.Management/Get-Content.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 01/18/2026 +ms.date: 03/11/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/get-content?view=powershell-7.5&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -60,8 +60,8 @@ Get-Content -Path .\LineNumbers.txt ``` ```Output -This is Line 1 -This is Line 2 +This is line 1. +This is line 2. ... This is line 99. This is line 100. @@ -83,11 +83,11 @@ Get-Content -Path .\LineNumbers.txt -TotalCount 5 ``` ```Output -This is Line 1 -This is Line 2 -This is Line 3 -This is Line 4 -This is Line 5 +This is line 1. +This is line 2. +This is line 3. +This is line 4. +This is line 5. ``` ### Example 3: Get a specific line of content from a text file @@ -101,7 +101,7 @@ that content. The **TotalCount** parameter gets the first 25 lines of content. T ``` ```Output -This is Line 25 +This is line 25. ``` The `Get-Content` command is wrapped in parentheses so that the command completes before going to @@ -119,7 +119,7 @@ Get-Item -Path .\LineNumbers.txt | Get-Content -Tail 1 ``` ```Output -This is Line 100 +This is line 100. ``` This example uses the `Get-Item` cmdlet to demonstrate that you can pipe files to `Get-Content`. The diff --git a/reference/7.6/Microsoft.PowerShell.Management/Get-Content.md b/reference/7.6/Microsoft.PowerShell.Management/Get-Content.md index da4e3921f8c7..6a276e8627d3 100644 --- a/reference/7.6/Microsoft.PowerShell.Management/Get-Content.md +++ b/reference/7.6/Microsoft.PowerShell.Management/Get-Content.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Management -ms.date: 01/18/2026 +ms.date: 03/11/2026 online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.management/get-content?view=powershell-7.6&WT.mc_id=ps-gethelp schema: 2.0.0 aliases: @@ -60,8 +60,8 @@ Get-Content -Path .\LineNumbers.txt ``` ```Output -This is Line 1 -This is Line 2 +This is line 1. +This is line 2. ... This is line 99. This is line 100. @@ -83,11 +83,11 @@ Get-Content -Path .\LineNumbers.txt -TotalCount 5 ``` ```Output -This is Line 1 -This is Line 2 -This is Line 3 -This is Line 4 -This is Line 5 +This is line 1. +This is line 2. +This is line 3. +This is line 4. +This is line 5. ``` ### Example 3: Get a specific line of content from a text file @@ -101,7 +101,7 @@ that content. The **TotalCount** parameter gets the first 25 lines of content. T ``` ```Output -This is Line 25 +This is line 25. ``` The `Get-Content` command is wrapped in parentheses so that the command completes before going to @@ -119,7 +119,7 @@ Get-Item -Path .\LineNumbers.txt | Get-Content -Tail 1 ``` ```Output -This is Line 100 +This is line 100. ``` This example uses the `Get-Item` cmdlet to demonstrate that you can pipe files to `Get-Content`. The