Fixing cmdkey.exe not accepting passwords with spaces in them, also removing the credentials once the remote session ends

NOTE: This leaves a PowerShell resource remaining after the remote
session has finished and will need to be updated to fix this