Reputation: 9133
Want to have a better understanding of filter option like
This is yielding proper result
Get-WmiObject -Class Win32_Service -Filter "Name = 'vss'"
How to have a wildcard search inside the filter without piping it to the where condition like :
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*'"
Upvotes: 4
Views: 7437
Reputation: 106
Get-WmiObject -Class Win32_Service -Filter "name LIKE 'vss%'"
It uses WQL for the filtering (% is wildcard)
Which ends up being run as
Get-WmiObject -Query "Select * From win32_service Where name Like 'vss%'"
Upvotes: 8