mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 09:30:43 +00:00
14 lines
390 B
TypeScript
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",
|
|
);
|
|
}
|