Skip to content

feat: integrate PSFramework for structured logging and configuration - #5

Open
BurtHarris with Copilot wants to merge 3 commits into
mainfrom
copilot/integrate-psframework
Open

BurtHarris with Copilot wants to merge 3 commits into
mainfrom
copilot/integrate-psframework

Conversation

Copilot AI commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

Wires in PSFramework as a first-class dependency, replacing ad-hoc Write-Output with structured, leveled messaging and adding a persistent config entry.

Module (PasskeyDiagnostics.psm1 / .psd1)

  • RequiredModules now enforces PSFramework >= 1.0.0
  • Write-Output replaced with Write-PSFMessage -Level Verbose — messages route to both the Verbose stream and the PSFramework in-memory/file log automatically
  • Stop-PSFFunction used for error handling (non-terminating, PSF-aware)
  • Set-PSFConfig -Initialize registers a PasskeyDiagnostics.LogLevel entry users can override via the PSFramework config system
# Messages are now inspectable after the fact
Get-PasskeyDiagnosticInfo
Get-PSFMessage   # shows timestamped, structured entries

# Logging behaviour is configurable
Set-PSFConfig -FullName 'PasskeyDiagnostics.LogLevel' -Value 'Host'

CI (.github/workflows/test.yml)

  • Added idempotent Install PSFramework step mirroring the existing Pester install pattern

Tests (PasskeyDiagnostics.Tests.ps1)

  • Added #Requires -Modules PSFramework
  • New contexts cover Get-PasskeyDiagnosticInfo return-value shape and the registered PSFramework config entry/default value

Copilot AI linked an issue Jul 7, 2026 that may be closed by this pull request
…onfiguration

- Add PSFramework >= 1.0.0 as RequiredModule in the manifest
- Replace Write-Output placeholder with Write-PSFMessage (Verbose)
- Add Stop-PSFFunction for error handling inside Get-PasskeyDiagnosticInfo
- Register PasskeyDiagnostics.LogLevel config via Set-PSFConfig -Initialize
- Add comment-based help to Get-PasskeyDiagnosticInfo
- Install PSFramework in CI workflow before running Pester tests
- Expand Pester tests: cover return-value properties and PSFramework config
- Update README: add PSFramework prerequisite and usage note

Closes #4
Copilot AI changed the title [WIP] Integrate PSFramework into existing code feat: integrate PSFramework for structured logging and configuration Jul 7, 2026
Copilot AI requested a review from BurtHarris July 7, 2026 18:45
@BurtHarris
BurtHarris marked this pull request as ready for review July 7, 2026 20:41
@BurtHarris

Copy link
Copy Markdown
Owner

@copilot resolve the merge conflicts in this pull request

# Conflicts:
#	PasskeyDiagnostics/PasskeyDiagnostics.psm1
#	README.md
#	tests/PasskeyDiagnostics.Tests.ps1

Copilot AI commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Merge conflicts resolved in commit 0dfda53.

What conflicted: PR #3 (merged to main after this branch was created) renamed PasskeyDiagnostics/ → MyModule/ as a generic template structure and added Initialize-Module.ps1. This caused delete/modify conflicts on the three PasskeyDiagnostics/ files this branch had modified.

How it was resolved:

  • PasskeyDiagnostics/PasskeyDiagnostics.psd1 — git's rename detection correctly mapped this to MyModule/MyModule.psd1, preserving the RequiredModules = @{ PSFramework ... } entry from this branch.
  • PasskeyDiagnostics/PasskeyDiagnostics.psm1 — removed (moved); PSFramework integration (#Requires -Modules PSFramework, Set-PSFConfig, Write-PSFMessage) applied to MyModule/MyModule.psm1 instead.
  • tests/PasskeyDiagnostics.Tests.ps1 — removed (moved); PSFramework #Requires and config tests added to tests/MyModule.Tests.ps1.
  • README.md — took main's template README verbatim; kept the PSFramework prerequisite line that both sides had added.

Copilot AI requested a review from BurtHarris July 8, 2026 03:21
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.

Integrate PSFramework

2 participants