Comparison of PowerShell where-object filtering and WQL syntax filtering
First, take a look at where-object filtering:
Get-WmiObject-Class Win32_Product-ComputerName. | | Where-Object-FilterScript {$_ .Name-eq "Microsoft .NET Framework 2.0"} | Format-List-Property * |
Here are two formats for WQL syntax filtering (one is regular, the other is escape)
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 *
You can also follow the official Wechat account below for more information.