PowerShell where-object篩選和WQL語法篩選對比

首先看看where-object篩選:微信

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

下面是WQL語法篩選的兩種格式(一個是常規方式,另一個是轉義符方式)ide

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語法篩選對比code

相關文章
相關標籤/搜索