Implement error handling
Use Invoke-Expression instead of Invoke-Command when the argument is a single string
Move the code to establish the pipe connection in the subprocess into the try block
Implement a debug mode activated by the False variable