3 ms·
Since Powershell isn't working on text but on objects, you might just want to use grep. Anyways, this should reproduce the output of grep in powershell: Get-
by asimops 6y ago
Since Powershell isn't working on text but on objects, you might just want to use grep.
Anyways, this should reproduce the output of grep in powershell:
Get-ChildItem -Recurse -File | Select-String "$pattern" -List -SimpleMatch -CaseSensitive | Select-Object -ExpandProperty path
You will want to only search in files for this to not ouput some lines of InputStream if there is a match in the actual path.
If $pattern is an actual regex you will want to drop SimpleMatch.
In case you want some proper powershell objects you might want to pipe this into Get-Item.