Skip to content

Commit 01b2a52

Browse files
authored
Refactor PowerShell usage to not require local script exec (#97)
1 parent a742e84 commit 01b2a52

3 files changed

Lines changed: 2 additions & 7 deletions

File tree

Engine/SQLCallStackResolver.Engine.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
</Target>
124124
<PropertyGroup>
125125
<PreBuildEvent>cd $(ProjectDir)
126-
powershell -File "$(ProjectDir)../utils/getBuildPreReqs.ps1"
126+
type ..\utils\import-vsenv.ps1 ..\utils\getBuildPreReqs.ps1 2&gt;nul | powershell
127127
</PreBuildEvent>
128128
</PropertyGroup>
129129
<PropertyGroup>

utils/getBuildPreReqs.ps1

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# Copyright (c) Microsoft Corporation.
22
# Licensed under the MIT License - see LICENSE file in this repo.
3-
4-
. "$PSScriptRoot/import-vsenv.ps1" # import VS environment
5-
63
if (-not (Test-Path DIA/Dia2Lib.dll)) {
74
pushd "$env:TEMP"
85
midl.exe /x64 /I "$env:VSINSTALLDIR/DIA SDK/include" "$env:VSINSTALLDIR/DIA SDK/idl/dia2.idl" /tlb dia2.tlb

utils/import-vsenv.ps1

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# Copyright (c) Microsoft Corporation.
22
# Licensed under the MIT License - see LICENSE file in this repo.
3-
43
$vsMaxVerFound = 0
54
$vsPath = (& "${env:ProgramFiles(x86)}/Microsoft Visual Studio/Installer/vswhere.exe" -latest -prerelease -property installationPath)
6-
if ($vsPath -eq $null) { Write-Error "No Visual Studio installation found. Exiting..." -ErrorAction Stop }
7-
else { Write-Host "Using Visual Studio from $vsPath" }
5+
if ($vsPath -eq $null) { Write-Error "No Visual Studio installation found. Exiting..." -ErrorAction Stop } else { Write-Host "Using Visual Studio from $vsPath" }
86

97
& "${env:COMSPEC}" /s /c "`"$vsPath\Common7\Tools\vsdevcmd.bat`" -no_logo && set" | foreach-object {
108
$name, $value = $_ -split '=', 2

0 commit comments

Comments
 (0)