diff options
| author | 5an7y-Microsoft <[email protected]> | 2025-07-31 10:18:59 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-31 10:18:59 -0700 |
| commit | 4f30b7f23e3c0c2a547a3a5cf27087f6bd95c9ad (patch) | |
| tree | f60a9fd354469cadd1d7ade6b90749da08c01f3f /Build-SampleSet.ps1 | |
| parent | a5566f00aefe1ac770a96b299fa62d1a6e3da831 (diff) | |
| parent | 121daafe556965527d95284b83dad9d9a8fb99ac (diff) | |
Merge pull request #1315 from microsoft/user/5an7y/EWDK-version-resolution
Build-sample set was printing an error message when trying to find the WDK version while using the EWDK. This PR fixed that by first checking the EWDK build environment.
Diffstat (limited to 'Build-SampleSet.ps1')
| -rw-r--r-- | Build-SampleSet.ps1 | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/Build-SampleSet.ps1 b/Build-SampleSet.ps1 index 270a7eaa..42ca7b9a 100644 --- a/Build-SampleSet.ps1 +++ b/Build-SampleSet.ps1 @@ -104,19 +104,20 @@ else { exit 1 } # -# Get the WDK extension version from installed packages -$wdk_extension_ver = Get-ChildItem "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=*" | Select-Object -ExpandProperty Name -$wdk_extension_ver = ([regex]'(\d+\.)(\d+\.)(\d+\.)(\d+)').Matches($wdk_extension_ver).Value -if (-not $wdk_extension_ver) { - # Be lenient with EWDK builds that do not include the package information - if ($build_environment -match '^EWDK') { - $wdk_extension_ver = "(package not found)" - } - else { + +# Be lenient with EWDK builds that do not include the package information +if ($build_environment -match '^EWDK') { + $wdk_extension_ver = "(package is not included for EWDK builds)" +} else { + # Get the WDK extension version from installed packages + $wdk_extension_ver = Get-ChildItem "${env:ProgramData}\Microsoft\VisualStudio\Packages\Microsoft.Windows.DriverKit,version=*" -ErrorAction SilentlyContinue + if (-not $wdk_extension_ver) { Write-Error "No version of the WDK Visual Studio Extension could be found. The WDK Extension is not installed." exit 1 } + $wdk_extension_ver = [regex]::Match($wdk_extension_ver.Name, '(\d+\.){3}\d+').Value } + # # # InfVerif_AdditionalOptions |
