希望更好地了解过滤器选项,例如
这产生了正确的结果
Get-WmiObject -Class Win32_Service -Filter "Name = 'vss'"
如何在过滤器内部进行通配符搜索,而不将其连接到where条件,如:
Get-WmiObject -Class Win32_Service -Filter "Name='v*'"
Get-WmiObject -Class Win32_Service -Filter "Name='*v*'"
Get-WmiObject -Class Win32_Service -Filter "Name='v'"
Get-WmiObject -Class Win32_Service -Filter "Name like 'v*'"
答案 0 :(得分:5)
Get-WmiObject -Class Win32_Service -Filter "name LIKE 'vss%'"
它使用WQL进行过滤(%是通配符)
最终以
运行Get-WmiObject -Query "Select * From win32_service Where name Like 'vss%'"