From 8e69be4fb7fe7c7410eeecb63c15b9f80829a3fd Mon Sep 17 00:00:00 2001 From: Carlos Rodrigues Date: Fri, 22 Dec 2023 11:14:32 +0000 Subject: [PATCH] Add Windows environment variable fallback for some broken systems (#328) --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 59a3de6..3e1a5af 100644 --- a/index.js +++ b/index.js @@ -169,7 +169,7 @@ const baseOpen = async options => { command = isWsl ? `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe` - : `${process.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell`; + : `${process.env.SYSTEMROOT || process.env.windir || 'C:\\Windows'}\\System32\\WindowsPowerShell\\v1.0\\powershell`; cliArguments.push( '-NoProfile',