This will encode the command you input into valid PowerShell Base64 for use with “EncodedCommand”.
Note: This is not a normal base64 encoder! It converts the string to UTF-16LE first before encoding, as that is what PowerShell expects!