diff --git a/win-vs-env.psm1 b/win-vs-env.psm1 index e9f3d1a..1eb9093 100644 --- a/win-vs-env.psm1 +++ b/win-vs-env.psm1 @@ -3,7 +3,7 @@ ### function Get-VSWhere { - $vswhere = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" + $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"; if (-not (Test-Path $vswhere )) { [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 @@ -34,11 +34,9 @@ function Invoke-Environment } function Get-VSInstallationPath { - Write-Host "ProgramFiles(x86) - ${env:ProgramFiles(x86)}" $vswhere = Get-VSWhere - Write-Host "vswhere - $vswhere" $installationPath = & $vswhere -prerelease -legacy -latest -property installationPath - Write-Host "installationPath - $installationPath" + return $installationPath }