Wildcard Search in -Filter

Viewed 4483

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*'"
1 Answers
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%'"
Related