Skip to content

Consolidate download build scripts into shared utility#6271

Draft
guimafelipe wants to merge 1 commit intomainfrom
user/felipeda/unifyingdownloadscripts
Draft

Consolidate download build scripts into shared utility#6271
guimafelipe wants to merge 1 commit intomainfrom
user/felipeda/unifyingdownloadscripts

Conversation

@guimafelipe
Copy link
Contributor

Summary

Consolidates three nearly identical download scripts into a shared Download-Package.ps1 utility, reducing code duplication in the build infrastructure.

Changes

  • New: build/scripts/Download-Package.ps1 — shared download utility with CmdletBinding, comment-based help, parameter validation, and proper error handling (try/catch with exit codes)
  • Modified: DownloadVCLibsDesktop.ps1, DownloadVCRedistInstaller.ps1, DownloadDotNetRuntimeInstaller.ps1 — converted to thin wrappers that resolve their component-specific URL/filename and delegate to Download-Package.ps1

Why

The three download scripts had identical structure (create output dir → build URL → skip if exists → download via Invoke-WebRequest). Any bug fix or improvement had to be applied three times. Now the common logic lives in one place.

Backward Compatibility

The three wrapper scripts preserve their original -Platform / -OutputDirectory parameter interface, so the pipeline YAML (WindowsAppSDK-SetupBuildEnvironment-Steps.yml) requires no changes.

@guimafelipe
Copy link
Contributor Author

guimafelipe commented Mar 5, 2026

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

1 similar comment
@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@guimafelipe guimafelipe marked this pull request as draft March 5, 2026 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant