@@ -124,7 +124,14 @@ steps:
124124 - label : " :windows: install_windows_10_sdk Tests - Standard version file"
125125 command : |
126126 echo '20348' > .windows-10-sdk-version
127- bin/install_windows_10_sdk.ps1 -DryRun
127+ $output = bin/install_windows_10_sdk.ps1 -DryRun
128+ $exitCode = $LASTEXITCODE
129+ if ($exitCode -ne 0) {
130+ echo "Unexpected failure. Exit code: $exitCode"
131+ echo "Output:"
132+ echo $output
133+ exit 1
134+ }
128135 agents :
129136 queue : windows
130137 notify :
@@ -133,8 +140,19 @@ steps:
133140
134141 - label : " :windows: install_windows_10_sdk Tests - Version file with new lines"
135142 command : |
136- echo "20348\n\n" > .windows-10-sdk-version
137- bin/install_windows_10_sdk.ps1 -DryRun
143+ echo "20348`n`n" > .windows-10-sdk-version
144+ $output = bin/install_windows_10_sdk.ps1 -DryRun
145+ $exitCode = $LASTEXITCODE
146+ if ($exitCode -ne 0) {
147+ echo "Unexpected failure. Exit code: $exitCode"
148+ echo "Output:"
149+ echo $output
150+ exit 1
151+ }
152+ if (($output -notmatch "[!] Invalid version file format") -and ($output -notmatch "Expected exactly one non-empty line")) {
153+ echo "Failure message did not match expectation."
154+ exit 1
155+ }
138156 agents :
139157 queue : windows
140158 notify :
@@ -144,7 +162,18 @@ steps:
144162 - label : " :windows: install_windows_10_sdk Tests - Version file with a word"
145163 command : |
146164 echo "not an integer" > .windows-10-sdk-version
147- bin/install_windows_10_sdk.ps1 -DryRun
165+ $output = bin/install_windows_10_sdk.ps1 -DryRun
166+ $exitCode = $LASTEXITCODE
167+ if ($exitCode -ne 1) {
168+ echo "Expected exit code 1, got: $exitCode"
169+ echo "Output:"
170+ echo $output
171+ exit 1
172+ }
173+ if (($output -notmatch "[!] Invalid version file format") -and ($output -notmatch "Expected an integer, got:'")) {
174+ echo "Failure message did not match expectation."
175+ exit 1
176+ }
148177 agents :
149178 queue : windows
150179 notify :
0 commit comments