Try doubling your \, I had a similar issue today with win32_volume. I think the \ needed to be escaped.
I'm not at work now so I can't remember if it was the filter or the replace statement I did it on. T On 3 Oct 2014 17:26, "Michael Leone" <[email protected]> wrote: > I want to try a Get-WmiObject that uses a Filter for executable path. > But it's failing. If I filter for just the name of the exe I want, it > works. And one of the properties returned is ExecutablePath > > ExecutablePath Property string ExecutablePath {get;set;} > > and that property gives me what I want: > > C:\Windows\system32\calc.exe > > So why can't I do this? > > PS C:\Windows\system32> $a=(Get-WmiObject -Class win32_process > -ComputerName "xxxx" -Filter > "ExecutablePath='C:\Windows\system32\calc.exe'") > $a > > Get-WmiObject : Invalid query "select * from win32_process where > ExecutablePath='C:\Windows\system32\calc.exe'" > At line:1 char:5 > + $a=(Get-WmiObject -Class win32_process -ComputerName "DCTRRDS003" > -Filter "Execu ... > + > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > + CategoryInfo : InvalidArgument: (:) [Get-WmiObject], > ManagementException > + FullyQualifiedErrorId : > GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand > > >

