From 90d86512f47597949bd27265c8e93c64878cf63e Mon Sep 17 00:00:00 2001 From: Refael Ackermann Date: Thu, 14 Sep 2017 17:23:31 -0400 Subject: [PATCH] win: run PS with `-NoProfile` PR-URL: https://github.com/nodejs/node-gyp/pull/1292 Refs: https://github.com/nodejs/node-gyp/issues/1195#issuecomment-329574067 Reviewed-By: Ben Noordhuis --- lib/find-vs2017.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/find-vs2017.js b/lib/find-vs2017.js index 8c79e9ec9b..ad46ceaf88 100644 --- a/lib/find-vs2017.js +++ b/lib/find-vs2017.js @@ -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' },