In PowerShell I have tried:
alias | select-string Alias
This fails even though Alias
is clearly in the output. I know this is because select-string is operating on some object and not the actual output string.
What can be done about it?
Use Select-String in a function: PS C:\> function search-help { $pshelp = "$pshome\es\about_*. txt", "$pshome\en-US\*dll-help. xml" Select-String -path $pshelp -Pattern $args[0] } This simple function uses the Select-String cmdlet to search the Windows PowerShell Help files for a particular string.
I think this solution is easier and better, use directly the function findstr:
alias | findstr -i Write
You can also make an alias to use grep word:
new-alias grep findstr
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With