File tree Expand file tree Collapse file tree
reference/7.5/Microsoft.PowerShell.Management Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,8 +60,8 @@ Get-Content -Path .\LineNumbers.txt
6060```
6161
6262``` Output
63- This is Line 1
64- This is Line 2
63+ This is Line 1.
64+ This is Line 2.
6565...
6666This is line 99.
6767This is line 100.
@@ -83,11 +83,11 @@ Get-Content -Path .\LineNumbers.txt -TotalCount 5
8383```
8484
8585``` Output
86- This is Line 1
87- This is Line 2
88- This is Line 3
89- This is Line 4
90- This is Line 5
86+ This is Line 1.
87+ This is Line 2.
88+ This is Line 3.
89+ This is Line 4.
90+ This is Line 5.
9191```
9292
9393### 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
101101```
102102
103103``` Output
104- This is Line 25
104+ This is Line 25.
105105```
106106
107107The ` 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
119119```
120120
121121``` Output
122- This is Line 100
122+ This is Line 100.
123123```
124124
125125This example uses the ` Get-Item ` cmdlet to demonstrate that you can pipe files to ` Get-Content ` . The
You can’t perform that action at this time.
0 commit comments