Skip to content

Commit

Permalink
win: run PS with -NoProfile
Browse files Browse the repository at this point in the history
PR-URL: #1292
Refs: #1195 (comment)
Reviewed-By: Ben Noordhuis <[email protected]>
  • Loading branch information
refack committed Sep 19, 2017
1 parent 7245415 commit 63f43c2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/find-vs2017.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ function findVS2017(callback) {
var ps = path.join(process.env.SystemRoot, 'System32', 'WindowsPowerShell',
'v1.0', 'powershell.exe')
var csFile = path.join(__dirname, 'Find-VS2017.cs')
var psArgs = ['-ExecutionPolicy', 'Unrestricted', '-Command',
'&{Add-Type -Path \'' + csFile +
'\'; [VisualStudioConfiguration.Main]::Query()}']
var psArgs = ['-ExecutionPolicy', 'Unrestricted', '-NoProfile',
'-Command', '&{Add-Type -Path \'' + csFile + '\';' +
'[VisualStudioConfiguration.Main]::Query()}']

log.silly('find vs2017', 'Running', ps, psArgs)
var child = execFile(ps, psArgs, { encoding: 'utf8' },
Expand Down

1 comment on commit 63f43c2

@jhenkens
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just wasted two days tracking down node-gyp issues to this exact change. Would be nice if this shipped.

Please sign in to comment.