Trying to run the following command in php to run powershell command...
the following works:
$output = shell_exec(escapeshellcmd(\'powershell get-ser
'powershell get-service | group-object'
will be interpreted as
What you want is for powershell to see get-service | group-object as it's argument, so you have to enclose that in quotes, like this.
$output = shell_exec('powershell "get-service | group-object"');