22external help file : Microsoft.PowerShell.Commands.Management.dll-Help.xml
33Locale : en-US
44Module Name : Microsoft.PowerShell.Management
5- ms.date : 01/18 /2026
5+ ms.date : 03/11 /2026
66online version : https://learn.microsoft.com/powershell/module/microsoft.powershell.management/get-content?view=powershell-5.1&WT.mc_id=ps-gethelp
77schema : 2.0.0
88aliases :
@@ -58,8 +58,8 @@ Get-Content -Path .\LineNumbers.txt
5858```
5959
6060``` Output
61- This is Line 1
62- This is Line 2
61+ This is line 1.
62+ This is line 2.
6363...
6464This is line 99.
6565This is line 100.
@@ -81,11 +81,11 @@ Get-Content -Path .\LineNumbers.txt -TotalCount 5
8181```
8282
8383``` Output
84- This is Line 1
85- This is Line 2
86- This is Line 3
87- This is Line 4
88- This is Line 5
84+ This is line 1.
85+ This is line 2.
86+ This is line 3.
87+ This is line 4.
88+ This is line 5.
8989```
9090
9191### 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
9999```
100100
101101``` Output
102- This is Line 25
102+ This is line 25.
103103```
104104
105105The ` 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
117117```
118118
119119``` Output
120- This is Line 100
120+ This is line 100.
121121```
122122
123123This 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`.
132132
133133``` powershell
134134Set-Content -Path .\Stream.txt -Value 'This is the content of the Stream.txt file'
135- # Specify a wildcard to the Stream parameter to display all streams of the recently created file.
135+ # Specify a wildcard to the Stream parameter to display all streams of the recently
136+ # created file.
136137Get-Item -Path .\Stream.txt -Stream *
137138```
138139
@@ -171,7 +172,8 @@ This is the content of the Stream.txt file
171172```
172173
173174``` powershell
174- # Use the Stream parameter of Add-Content to create a new Stream containing sample content.
175+ # Use the Stream parameter of Add-Content to create a new Stream containing sample
176+ # content.
175177$addContentSplat = @{
176178 Path = '.\Stream.txt'
177179 Stream = 'NewStream'
@@ -215,7 +217,7 @@ Added a stream named NewStream to Stream.txt
215217```
216218
217219The ** Stream** parameter is a dynamic parameter of the
218- [ FileSystem provider] ( ../microsoft.powershell.core/about/about_filesystem_provider .md#stream-string ) .
220+ [ FileSystem provider] ( ../Microsoft.PowerShell.Core/About/about_FileSystem_Provider .md#stream-string ) .
219221By default ` Get-Content ` only retrieves data from the default, or ` :$DATA ` stream. ** Streams** can
220222be used to store hidden data such as attributes, security settings, or other data. They can also be
221223stored on directories without being child items.
@@ -457,7 +459,7 @@ it in single quotation marks. Single quotation marks tell PowerShell not to inte
457459as escape sequences.
458460
459461For more information, see
460- [about_Quoting_Rules](../Microsoft.Powershell .Core/About/about_Quoting_Rules.md).
462+ [about_Quoting_Rules](../Microsoft.PowerShell .Core/About/about_Quoting_Rules.md).
461463
462464` ` ` yaml
463465Type: System.String[]
0 commit comments