Skip to content

Commit

Permalink
Add dry run flag to install Win 10 SDK script
Browse files Browse the repository at this point in the history
  • Loading branch information
mokagio committed Feb 19, 2025
1 parent 8ab9c4f commit 13e2b9c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ steps:
- label: ":windows: install_windows_10_sdk Tests - Standard version file"
command: |
echo '20348' > .windows-10-sdk-version
bin/install_windows_10_sdk.ps1
bin/install_windows_10_sdk.ps1 -DryRun
agents:
queue: windows
notify:
Expand All @@ -134,7 +134,7 @@ steps:
- label: ":windows: install_windows_10_sdk Tests - Version file with new lines"
command: |
echo "20348\n\n" > .windows-10-sdk-version
bin/install_windows_10_sdk.ps1
bin/install_windows_10_sdk.ps1 -DryRun
agents:
queue: windows
notify:
Expand All @@ -144,7 +144,7 @@ steps:
- label: ":windows: install_windows_10_sdk Tests - Version file with a word"
command: |
echo "not an integer" > .windows-10-sdk-version
bin/install_windows_10_sdk.ps1
bin/install_windows_10_sdk.ps1 -DryRun
agents:
queue: windows
notify:
Expand Down
9 changes: 9 additions & 0 deletions bin/install_windows_10_sdk.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
param ( # parameters need to be defined at the top of the script
[switch]$DryRun = $false
)

# Stop script execution when a non-terminating error occurs
$ErrorActionPreference = "Stop"

Expand Down Expand Up @@ -27,6 +31,11 @@ if ($windows10SDKVersion -notmatch '^\d+$') {

Write-Host "Will attempt to set up Windows 10 ($windows10SDKVersion) SDK and Visual Studio Build Tools..."

if ($DryRun) {
Write-Output "Running in dry run mode, finishing here."
exit 0
}

# Download the Visual Studio Build Tools Bootstrapper
Write-Output "~~~ Downloading Visual Studio Build Tools..."

Expand Down

0 comments on commit 13e2b9c

Please sign in to comment.