I\'m having an issue with powershell when invoking an exe at a path containing spaces.
PS C:\\Windows Services> invoke-expression \"C:\\Windows Services\\My
You can escape the space by using single quotations and a backtick before the space:
$path = 'C:\Windows Services\MyService.exe' $path -replace ' ', '` ' invoke-expression $path