I am trying to solve the following problem in a php script.
This works:
system("powershell -command get-wmiobject win32_service -computername SERVER1");
It returns the expected results.
However, this returns nothing:
system("powershell -command get-wmiobject win32_service -computername SERVER1 -filter "startmode='auto'"");
I've tried escaping the single and double quotes in almost every possible combination. For example:
...SERVER1 -filter \"startmode=\'auto\'\"
and
...SERVER1 -filter \"startmode='auto'\"
And nothing seems to work past the SERVER1.
Anyone have any ideas?