diff --git a/lib/find-visualstudio.js b/lib/find-visualstudio.js index f2cce327e7..826c80e25c 100644 --- a/lib/find-visualstudio.js +++ b/lib/find-visualstudio.js @@ -127,6 +127,10 @@ VisualStudioFinder.prototype = { findVisualStudio2017OrNewer: function findVisualStudio2017OrNewer (cb) { var ps = path.join(process.env.SystemRoot, 'System32', 'WindowsPowerShell', 'v1.0', 'powershell.exe') + if (process.env.NODE_GYP_POWERSHELL_PATH) { + ps = path.resolve(process.env.NODE_GYP_POWERSHELL_PATH) + this.addLog('PowerShell path has been set by NODE_GYP_POWERSHELL_PATH:', ps) + } var csFile = path.join(__dirname, 'Find-VisualStudio.cs') var psArgs = [ '-ExecutionPolicy',