MCPcopy Create free account
hub / github.com/freecodexyz/free-code / encodePowerShellCommand

Function encodePowerShellCommand

src/utils/shell/powershellProvider.ts:23–25  ·  view source on GitHub ↗

* Base64-encode a string as UTF-16LE for PowerShell's -EncodedCommand. * Same encoding the parser uses (parser.ts toUtf16LeBase64). The output * is [A-Za-z0-9+/=] only — survives ANY shell-quoting layer, including * @anthropic-ai/sandbox-runtime's shellquote.quote() which would otherwise * corru

(psCommand: string)

Source from the content-addressed store, hash-verified

21 * quotes. Review 2964609818.
22 */
23function encodePowerShellCommand(psCommand: string): string {
24 return Buffer.from(psCommand, 'utf16le').toString('base64')
25}
26
27export function createPowerShellProvider(shellPath: string): ShellProvider {
28 let currentSandboxTmpDir: string | undefined

Callers 1

buildExecCommandFunction · 0.85

Calls 1

toStringMethod · 0.65

Tested by

no test coverage detected