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", ); }