File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,21 @@ if (-not (Test-Path $windowsSDKVersionFile)) {
99 exit 1
1010}
1111
12- $windows10SDKVersion = Get-Content $windowsSDKVersionFile
12+ $windows10SDKVersion = Get-Content $windowsSDKVersionFile `
13+ | Where-Object { $_ -match ' \S' } # Remove empty lines
14+
15+ if ($windows10SDKVersion.Count -ne 1 ) {
16+ Write-Output " [!] Invalid version file format."
17+ Write-Output " Expected exactly one non-empty line, got:"
18+ Write-Output ($windows10SDKVersion -join " `n " ) # The join poperly formats multiple lines
19+ exit 1
20+ }
21+
22+ if ($windows10SDKVersion -notmatch ' ^\d+$' ) {
23+ Write-Output " [!] Invalid version format."
24+ Write-Output " Expected an integer, got: '$windows10SDKVersion '"
25+ exit 1
26+ }
1327
1428Write-Host " Will attempt to set up Windows 10 ($windows10SDKVersion ) SDK and Visual Studio Build Tools..."
1529
You can’t perform that action at this time.
0 commit comments