Powershell Newbie: How do I filter results so that only the information I get back can be used in a pipeline?
Lets say I run a powershell command (in my case Group Policy related) but lets say I run this command:
PS C:>Get-GPO -All
and my output l开发者_如何学编程ooks like:
DisplayName : My Named GPO
DomainName : mydomain.com
Owner : Domain Admins
Id : Random_GUID ...
How can I "filter" that command so that it only returns the lines relating to DisplayName? Is that possible or will I need to do some string parsing that's not available inside a pipeline operation? Because ultimately, I'm looking to use that DisplayName param to pipe to another command.
Thanks in advance!
You can use Select-Object (or select in short)
Get-GPO -All | Select DisplayName
精彩评论