Download, verify, and extract
July 9, 2026 · View on GitHub
This directory contains shared utility scripts and modules used across the
hve-core automation scripts.
Scripts
Get-VerifiedDownload.ps1
Downloads and verifies artifacts using SHA256 checksums.
Purpose: Provide tamper-evident file downloads for CI tooling.
Features
- Downloads files from a URL and verifies against an expected SHA256 hash
- Supports optional extraction of archives
- Exposes
Get-FileHashValueandTest-HashMatchfunctions for reuse
Parameters
-Url- Download URL-ExpectedSHA256- Expected SHA256 hash for verification-OutputPath- Local file path for the download-Extract(switch) - Extract the downloaded archive after verification-ExtractPath- Destination path for extraction
Usage
# Download and verify a tool
./scripts/lib/Get-VerifiedDownload.ps1 -Url "https://example.com/tool.zip" `
-ExpectedSHA256 "abc123..." -OutputPath "./tools/tool.zip"
# Download, verify, and extract
./scripts/lib/Get-VerifiedDownload.ps1 -Url "https://example.com/tool.zip" `
-ExpectedSHA256 "abc123..." -OutputPath "./tools/tool.zip" `
-Extract -ExtractPath "./tools/"
Modules
Modules/CIHelpers.psm1
Shared CI platform detection and output utilities imported by scripts across the repository.
| Function | Purpose |
|---|---|
ConvertTo-GitHubActionsEscaped | Escapes strings for GitHub Actions workflow commands |
ConvertTo-AzureDevOpsEscaped | Escapes strings for Azure DevOps logging commands |
Get-CIPlatform | Returns the current CI platform (GitHub, AzureDevOps) |
Test-CIEnvironment | Detects whether the script runs in a CI environment |
Set-CIOutput | Sets output variables for the current CI platform |
Set-CIEnv | Sets environment variables for the current CI platform |
Write-CIStepSummary | Appends content to the GitHub Actions step summary |
Write-CIAnnotation | Writes a single CI warning or error annotation |
Write-CIAnnotations | Writes multiple CI annotations from a violations array |
Set-CITaskResult | Sets the CI task result (succeeded, failed) |
Publish-CIArtifact | Publishes a file as a CI artifact |
Modules/CopyrightHeader.psm1
Single source of truth for the canonical copyright and SPDX license header
lines shared by scripts/linting/Test-CopyrightHeaders.ps1 and the copyright
header checks.
| Function | Purpose |
|---|---|
Get-CopyrightLineRegex | Returns the regex matching an acceptable copyright line |
Get-SpdxLineRegex | Returns the regex matching an acceptable SPDX identifier line |
Get-CanonicalHeaderLines | Returns the canonical copyright and SPDX header lines to insert |
Related Documentation
- Scripts README for overall script organization
🤖 Crafted with precision by ✨Copilot following brilliant human instruction, then carefully refined by our team of discerning human reviewers.