Skip to content

Conversation

Copy link

Copilot AI commented Jan 2, 2026

Adds comprehensive Pester tests for the YamlCreate.InstallerDetection PowerShell module, which provides installer type detection and PE file parsing capabilities.

Changes

  • YamlCreate.InstallerDetection.Tests.ps1 (375 lines, 35 tests)

    • Tests for all 11 exported functions covering byte manipulation, PE section parsing, and installer type detection (ZIP, MSIX, MSI, WIX, Nullsoft, Inno, Burn, fonts)
    • Stub functions for external dependencies (Get-MSITable, Get-MSIProperty, Get-Win32ModuleResource) that may not be available in all test environments
    • 32 passing tests with proper cleanup of temporary test files
  • README.md

    • Usage examples for running tests with Pester
    • Test structure documentation and coverage overview
    • Known limitations for tests requiring complex binary structures
  • .github/workflows/pesterTests.yaml

    • GitHub Actions workflow that automatically runs all Pester tests on pull requests and pushes
    • Discovers and executes all *.Tests.ps1 files in the repository
    • Based on the existing ScriptAnalyzer workflow template
    • Runs on Windows runners with Pester 5.x

Test Coverage

# Module validation
Get-Module 'YamlCreate.InstallerDetection' | Should -Not -BeNullOrEmpty

# Byte extraction with endianness
Get-OffsetBytes -ByteArray $bytes -Offset 2 -Length 3 -LittleEndian $true

# Font signature detection
Test-IsFont -Path $file  # TTF: 0x00010000, OTF: OTTO, TTC: ttcf

# Main resolver following detection priority
Resolve-InstallerType -Path $installer  # Returns: font, wix, msi, msix, zip, nullsoft, inno, burn, or $null

Test results: 32 passed, 3 skipped (require valid ZIP/PE structures), 0 failed.

Original prompt

On YamlCreate.InstallerDetection, Create a new set of Pester tests for the Powershell module at Tools/Modules/YamlCreate/YamlCreate.InstallerDetection


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add Pester tests for YamlCreate.InstallerDetection module Add Pester test suite for YamlCreate.InstallerDetection module Jan 2, 2026
Copilot AI requested a review from Trenly January 2, 2026 23:41
@Trenly
Copy link
Owner

Trenly commented Jan 2, 2026

@copilot - Add a workflow file that will run all the pester tests when a Pull request is submitted. Use the workflow file which calls ScriptAnalzyer as a template

Copy link
Author

Copilot AI commented Jan 2, 2026

@copilot - Add a workflow file that will run all the pester tests when a Pull request is submitted. Use the workflow file which calls ScriptAnalzyer as a template

Added GitHub Actions workflow file .github/workflows/pesterTests.yaml that runs all Pester tests on pull requests and pushes. The workflow is based on the ScriptAnalyzer template and automatically discovers and runs all *.Tests.ps1 files in the repository. Commit: 6bd2301

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants