PowerShell5 index[0] to the first instance of the string, index[1] to the second instance and so on till finished on a 6800 line windows10 batch file
问题 Powershell5 script choking on special characters in a Windows 10 batch file or is my code fundamentally wrong? Parse 6800 line Windows 10 batch file, find string {LINE2 1-9999} and replace {1-9999} with the line number the code is on, re-write the batch file. There are 54 instances of {LINE2 1-9999}. If I parse the entire batch the first 54 lines are outputed, none of which contains the string. $lines = sls "LINE2" $env:windir\_61.bat | Select-Object -ExpandProperty LineNumber gc $env:windir\