Files
openclaw/scripts/e2e/parallels/powershell.ts
2026-04-29 12:53:58 +01:00

14 lines
390 B
TypeScript

export function psSingleQuote(value: string): string {
return `'${value.replaceAll("'", "''")}'`;
}
export function psArray(values: string[]): string {
return `@(${values.map(psSingleQuote).join(", ")})`;
}
export function encodePowerShell(script: string): string {
return Buffer.from(`$ProgressPreference = 'SilentlyContinue'\n${script}`, "utf16le").toString(
"base64",
);
}