Get the App
SLTechnology News&Howtos  ›  Servers  › 

Comparison of PowerShell where-object filtering and WQL syntax filtering

Shulou Source: shulou.com Published: 2022-06-02 17:22:04 10月03日 Update

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.

Tags: Way grammar public general more format information escape Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Shulou Information Shulou Technology NVidia Huawei