|
$ReturnString = & $ServiceControlCmd.Definition $Arguments |
I had to change this to:
$Command = "$($ServiceControlCmd.Definition) $Arguments"
$ReturnString = Invoke-Expression $Command
This resolved an issue I had when working with a service that contained square brackets [ ] in the name.