首先看看where-object筛选:

Get-WmiObject -Class Win32_Product -ComputerName . | Where-Object -FilterScript {$_.Name -eq "Microsoft .NET Framework 2.0"} | Format-List -Property *

下面是WQL语法筛选的两种格式(一个是常规方式,另外一个是转义符方式)

Get-WmiObject -Class Win32_Product -ComputerName . -Filter "Name='Microsoft .NET Framework 2.0'"| Format-List -Property *
Get-WmiObject -Class Win32_Product -ComputerName . -Filter Name`=`'Microsoft` .NET` Framework` 2.0`' | Format-List -Property *

您也可以关注下方微信公众号获取更多资讯
PowerShell where-object筛选和WQL语法筛选对比_第1张图片