This should be simple but I just haven’t been able to figure it out. How to I implement an or clause with a Get-CimInstance filter? I’m filling an XAML listview with processes and I only want to return powershell, powershell_ise or pwsh but I can’t figure out how to do an -or clause properly. I’ve tried:
Get-CimInstance -ClassName Win32_Process -Filter "Name like 'Powershell%'" -or "Name like 'pwsh%'"
Get-CimInstance -ClassName Win32_Process -Filter ("Name like 'Powershell%'") -or "(Name like 'pwsh%'")
but these don’t work. I get “Get-CimInstance : A parameter cannot be found that matches parameter name ‘or’.”
I would think this would be easier than this.