summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author5an7y <[email protected]>2025-07-30 13:30:21 -0700
committer5an7y <[email protected]>2025-07-30 13:30:21 -0700
commit121daafe556965527d95284b83dad9d9a8fb99ac (patch)
tree25d5b9c35ecb4ddcfdf4c239f0f6db8de744b4f3
parent7bc5255321145137d51beff5cc450932cb8db8b7 (diff)
Fix the wdk version in EWDK
-rw-r--r--Build-SampleSet.ps119
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