Skip to content

Add Pester test suite for YamlCreate.InstallerDetection module#203

Draft
Copilot wants to merge 6 commits intomasterfrom
copilot/add-pester-tests-for-installer-detection
Draft

Add Pester test suite for YamlCreate.InstallerDetection module#203
Copilot wants to merge 6 commits intomasterfrom
copilot/add-pester-tests-for-installer-detection

Conversation

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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

Copilot AI and others added 3 commits March 20, 2026 16:22
Co-authored-by: Trenly <12611259+Trenly@users.noreply.github.com>
Co-authored-by: Trenly <12611259+Trenly@users.noreply.github.com>
Co-authored-by: Trenly <12611259+Trenly@users.noreply.github.com>
@Trenly Trenly force-pushed the copilot/add-pester-tests-for-installer-detection branch from 113e497 to 6987a50 Compare March 20, 2026 21:23
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