From c869cde1498b87cda69aa682c47d268a5f4f1a76 Mon Sep 17 00:00:00 2001 From: Khairul Azhar Kasmiran Date: Sat, 28 Jun 2025 13:56:21 +0800 Subject: [PATCH] Set `-ExecutionPolicy Bypass` on PowerShell script execution --- lib/GenerateConsoleCtrlEvent.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/GenerateConsoleCtrlEvent.js b/lib/GenerateConsoleCtrlEvent.js index 72840d7..a386d47 100644 --- a/lib/GenerateConsoleCtrlEvent.js +++ b/lib/GenerateConsoleCtrlEvent.js @@ -28,7 +28,13 @@ const GenerateConsoleCtrlEvent = kernel32 (...args) => promisify(cp.execFile)(...args).then(({ stdout }) => stdout), (args) => [ "powershell.exe", - ["-File", path.join(__dirname, "..", "generate-ctrl-event.ps1"), ...args], + [ + "-ExecutionPolicy", + "Bypass", + "-File", + path.join(__dirname, "..", "generate-ctrl-event.ps1"), + ...args, + ], { stdio: ["ignore", "pipe", "pipe"] }, ], (buffer) => {