|
|
|
|
|
by AskewEgret
2977 days ago
|
|
Of course. Get-Content puts every line of text into the pipeline as a .Net String object with a few additional attributes added on, including ReadCount which is the line number. For example: Get-Content -Path TEXT.TXT | %{"$($_.ReadCount) $($_.Length) $($_.ToUpper())" } For each line of text, this will print the line number, the length of the string, and the string converted into upper case. PowerShell is very wordy, but very powerful. |
|
I mean I still can't wrap my head around [ being a command / executable usable in conditions.