From 2e07f1b58a93eb36c616192045db654cf043a670 Mon Sep 17 00:00:00 2001 From: Matt <138825652+middlemose@users.noreply.github.com> Date: Tue, 25 Jun 2024 12:50:00 -0700 Subject: Fix printing vsix version --- Build-SampleSet.ps1 | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'Build-SampleSet.ps1') diff --git a/Build-SampleSet.ps1 b/Build-SampleSet.ps1 index 5be14dcf..2fccfdb8 100644 --- a/Build-SampleSet.ps1 +++ b/Build-SampleSet.ps1 @@ -164,12 +164,23 @@ $jresult = @{ $SolutionsTotal = $sampleSet.Count * $Configurations.Count * $Platforms.Count -Write-Output ("Build Environment: " + $build_environment) -if (($build_environment -eq "GitHub") -or ($build_environment -eq "NuGet")) { - Write-Output ("Nuget Package Version: " + $nuget_package_version) +# Find vsix version either from env variabel or from packages +$vsix_version = $env:SAMPLES_VSIX_VERSION +if (-not $vsix_version) { + $vsix_version = ls "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=*" | Select -ExpandProperty Name + if ($vsix_version) { + $vsix_version = $vsix_version.split('=')[1] + } + else { + Write-Error "No version for the WDK VSIX could be found. The WDK VSIX is not installed." + exit 1 + } } -Write-Output ("WDK VSIX Version: " + ($env:SAMPLES_VSIX_VERSION) ? $env:SAMPLES_VSIX_VERSION : (ls "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=*" | Select -ExpandProperty Name).split('=')[1]) + +Write-Output ("Build Environment: " + $build_environment) Write-Output ("Build Number: " + $build_number) +if (($build_environment -eq "GitHub") -or ($build_environment -eq "NuGet")) { Write-Output ("Nuget Package Version: " + $nuget_package_version) } +Write-Output ("WDK VSIX Version: " + $vsix_version) Write-Output ("Samples: " + $sampleSet.Count) Write-Output ("Configurations: " + $Configurations.Count + " (" + $Configurations + ")") Write-Output ("Platforms: " + $Platforms.Count + " (" + $Platforms + ")") -- cgit v1.3.1