Skip to main content

encode_powershell_command

Function encode_powershell_command 

Source
pub fn encode_powershell_command(script: &str) -> String
Expand description

Encode a PowerShell script as UTF-16LE base64 for use with -EncodedCommand.

This is the encoding format expected by powershell.exe -EncodedCommand. The input is converted to UTF-16LE and then base64-encoded, which avoids shell quoting and character escaping issues.