Using Powershell 3.0 I am trying to use the following "-filter" command line option to filter out directories that I do not want to scan when I try to remotely delete a directory list through WMI.
The LIKE parameter works fine, but I was not able to figure out what works for ANYTHING. I tried! LIKE NL, DO NOT LIKE. Until now, powershell did not like it ...
Get-WmiObject Win32_Directory -ComputerName "." -filter "name NOT LIKE '%oracle%'" | select name
Let me clarify here. I know the WHERE option, which will do this, but this parameter completes the scan of everything, it just does not display what you are filtering.
Ammer source share