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-FileHashValue and Test-HashMatch functions 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.

FunctionPurpose
ConvertTo-GitHubActionsEscapedEscapes strings for GitHub Actions workflow commands
ConvertTo-AzureDevOpsEscapedEscapes strings for Azure DevOps logging commands
Get-CIPlatformReturns the current CI platform (GitHub, AzureDevOps)
Test-CIEnvironmentDetects whether the script runs in a CI environment
Set-CIOutputSets output variables for the current CI platform
Set-CIEnvSets environment variables for the current CI platform
Write-CIStepSummaryAppends content to the GitHub Actions step summary
Write-CIAnnotationWrites a single CI warning or error annotation
Write-CIAnnotationsWrites multiple CI annotations from a violations array
Set-CITaskResultSets the CI task result (succeeded, failed)
Publish-CIArtifactPublishes 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.

FunctionPurpose
Get-CopyrightLineRegexReturns the regex matching an acceptable copyright line
Get-SpdxLineRegexReturns the regex matching an acceptable SPDX identifier line
Get-CanonicalHeaderLinesReturns the canonical copyright and SPDX header lines to insert

🤖 Crafted with precision by ✨Copilot following brilliant human instruction, then carefully refined by our team of discerning human reviewers.