11param (
22 [switch ]$Debug ,
3- [string ]$VisualStudioVersion = ' 14 .0' ,
3+ [string ]$VisualStudioVersion = ' 15 .0' ,
44 [switch ]$SkipKeyCheck ,
55 [string ]$Verbosity = ' minimal' ,
66 [string ]$Logger ,
@@ -37,7 +37,7 @@ If (-not (Test-Path $nuget)) {
3737 mkdir ' ..\.nuget'
3838 }
3939
40- $nugetSource = ' http ://nuget.org/nuget.exe'
40+ $nugetSource = ' https ://dist. nuget.org/win-x86-commandline/latest /nuget.exe'
4141 Invoke-WebRequest $nugetSource - OutFile $nuget
4242 If (-not $? ) {
4343 $host.ui.WriteErrorLine (' Unable to download NuGet executable, aborting!' )
@@ -46,7 +46,8 @@ If (-not (Test-Path $nuget)) {
4646}
4747
4848# build the main project
49- $msbuild = " ${env: ProgramFiles(x86)} \MSBuild\$VisualStudioVersion \Bin\MSBuild.exe"
49+ $visualStudio = (Get-ItemProperty ' HKLM:\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\SxS\VS7' )." $VisualStudioVersion "
50+ $msbuild = " $visualStudio \MSBuild\$VisualStudioVersion \Bin\MSBuild.exe"
5051If (-not (Test-Path $msbuild )) {
5152 $host.UI.WriteErrorLine (" Couldn't find MSBuild.exe" )
5253 exit 1
@@ -90,15 +91,15 @@ if (-not $SkipKeyCheck) {
9091 . .\keys.ps1
9192
9293 foreach ($pair in $Keys.GetEnumerator ()) {
93- $assembly = Resolve-FullPath - Path " ..\PublicApiAnalyzer\PublicApiAnalyzer.CodeFixes\bin\$BuildConfig \PublicApiAnalyzer.dll"
94+ $assembly = Resolve-FullPath - Path " ..\PublicApiAnalyzer\PublicApiAnalyzer.CodeFixes\bin\$BuildConfig \$ ( $pair .Key ) \ PublicApiAnalyzer.dll"
9495 # Run the actual check in a separate process or the current process will keep the assembly file locked
9596 powershell - Command " .\check-key.ps1 -Assembly '$assembly ' -ExpectedKey '$ ( $pair.Value ) ' -Build '$ ( $pair.Key ) '"
9697 If (-not $? ) {
9798 $host.ui.WriteErrorLine (' Failed to verify strong name key for build, aborting!' )
9899 exit $LASTEXITCODE
99100 }
100101
101- $assembly = Resolve-FullPath - Path " ..\PublicApiAnalyzer\PublicApiAnalyzer.CodeFixes\bin\$BuildConfig \PublicApiAnalyzer.CodeFixes.dll"
102+ $assembly = Resolve-FullPath - Path " ..\PublicApiAnalyzer\PublicApiAnalyzer.CodeFixes\bin\$BuildConfig \$ ( $pair .Key ) \ PublicApiAnalyzer.CodeFixes.dll"
102103 # Run the actual check in a separate process or the current process will keep the assembly file locked
103104 powershell - Command " .\check-key.ps1 -Assembly '$assembly ' -ExpectedKey '$ ( $pair.Value ) ' -Build '$ ( $pair.Key ) '"
104105 If (-not $? ) {
0 commit comments