Skip to content

Commit 0bc6e67

Browse files
committed
feat: adds environment variable to allow PowerShell executable to be specified
1 parent 0a67dcd commit 0bc6e67

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/find-visualstudio.js

+4
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ VisualStudioFinder.prototype = {
127127
findVisualStudio2017OrNewer: function findVisualStudio2017OrNewer (cb) {
128128
var ps = path.join(process.env.SystemRoot, 'System32',
129129
'WindowsPowerShell', 'v1.0', 'powershell.exe')
130+
if (process.env.NODE_GYP_POWERSHELL_PATH) {
131+
ps = path.resolve(process.env.NODE_GYP_POWERSHELL_PATH)
132+
this.addLog('PowerShell path has been set by NODE_GYP_POWERSHELL_PATH:', ps)
133+
}
130134
var csFile = path.join(__dirname, 'Find-VisualStudio.cs')
131135
var psArgs = [
132136
'-ExecutionPolicy',

0 commit comments

Comments
 (0)