feat(scripts): add verified download utility with hash checking#180
Merged
WilliamBerryiii merged 5 commits intomainfrom Feb 16, 2026
Merged
feat(scripts): add verified download utility with hash checking#180WilliamBerryiii merged 5 commits intomainfrom
WilliamBerryiii merged 5 commits intomainfrom
Conversation
- port Get-VerifiedDownload.ps1 from hve-core (zero-delta copy) - add Pester test suite for all download and hash functions - support SHA-256, SHA-384, SHA-512 with optional archive extraction 🔒 - Generated by Copilot
There was a problem hiding this comment.
Pull request overview
This PR ports the Get-VerifiedDownload.ps1 utility and its comprehensive Pester test suite from the hve-core repository as a zero-delta copy. The utility provides secure, hash-verified file downloads with support for SHA-256, SHA-384, and SHA-512 algorithms, plus optional archive extraction for .zip, .tar.gz, and .tar formats. The implementation follows a functional design pattern with 7 pure functions for testability and 1 I/O orchestrator function.
Changes:
- Added
Get-VerifiedDownload.ps1with hash-verified download and extraction capabilities - Added comprehensive Pester test suite with 37 tests covering all functions and edge cases
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| scripts/lib/Get-VerifiedDownload.ps1 | New utility script providing hash-verified downloads with multi-algorithm support (SHA-256/384/512) and archive extraction (zip, tar.gz, tar) |
| scripts/tests/lib/Get-VerifiedDownload.Tests.ps1 | Comprehensive Pester test suite with 37 tests covering pure functions, I/O orchestration, cache hits, hash mismatches, network errors, and extraction scenarios |
- add shebang and fix synopsis/description to list all hash algorithms - remove trailing whitespace from OutputPath parameter - move archive to target path before extraction so file persists on disk - add extraction logic to cache-hit path when Extract flag is set - add tests for archive persistence and cache-hit extraction 🔧 - Generated by Copilot
- return extractDir instead of targetPath in both download and cache-hit paths - update test assertion to verify result path equals extract directory 🐛 - Generated by Copilot
agreaves-ms
approved these changes
Feb 15, 2026
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
- fix TestPaths param name mismatch in pester-tests.yml workflow - scope ErrorActionPreference to function and main block - use targetPath instead of Url for archive type detection - update synopsis to clarify SHA-256 script-level support - fix Remove-Item mock to pass through in Pester tests 🔧 - Generated by Copilot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes #54
Adds
Get-VerifiedDownload.ps1, a hash-verified download utility supporting SHA-256, SHA-384, and SHA-512 checksum validation with optional archive extraction for.zip,.tar.gz,.tgz, and.tarformats. Ported from hve-core with bug fixes applied from review feedback.Get-VerifiedDownload.ps1with pure-function architecture for testability and an I/O wrapper for orchestrationExpand-Archiveortarruns-Extractflag is setType of Change
Component(s) Affected
deploy/000-prerequisites- Azure subscription setupdeploy/001-iac- Terraform infrastructuredeploy/002-setup- OSMO control plane / Helmdeploy/004-workflow- Training workflowssrc/training- Python training scriptsdocs/- DocumentationTesting Performed
planreviewed (no unexpected changes)applytested in dev environmentsmoke_test_azure.py)Documentation Impact
Checklist
🔧 - Generated by Copilot