diff --git a/scripts/src/ssh.ts b/scripts/src/ssh.ts index 4ced2e3a..977a2248 100644 --- a/scripts/src/ssh.ts +++ b/scripts/src/ssh.ts @@ -1058,6 +1058,14 @@ function parseWinRouteArgs(route: ParsedSshRoute, args: string[]): ParsedSshArgs } if (operation === "ps" || operation === "powershell" || operation === "powershell.exe") { const commandArgs = args[1] === "--" ? args.slice(2) : args.slice(1); + if (commandArgs.length >= 2 && (commandArgs[0] === "-File" || commandArgs[0] === "-file")) { + const fileArgs = commandArgs.slice(1).map((a: string) => a.replace(/\\/g, "/")).join(" "); + return { + remoteCommand: buildWindowsPowerShellInvocation(buildWindowsPowerShellInlineLauncherScript("& " + fileArgs, route.workspace)), + requiresStdin: false, + invocationKind: "helper", + }; + } if (commandArgs.length === 0) { return { remoteCommand: buildWindowsPowerShellInvocation(buildWindowsPowerShellStdinLauncherScript(route.workspace)),