Summary
The Effect enum defines Warn. The Configuration.psd1 Logging section uses the key Warning. Invoke-Logging looks up $config.Logging.$Effect — when Effect is Warn, it looks up Logging.Warn which doesn't exist. The lookup returns $null, the Enabled check fails, and Warn-effect logging is silently skipped every time.
Files
Gatekeeper/Private/Invoke-Logging.ps1:14
Gatekeeper/Configuration.psd1
guides/logging.md:80 (also uses the wrong key in the example)
Root Cause
# Configuration.psd1
Logging = @{
Warning = @{ Enabled = $false; Script = {...} } # key is 'Warning'
}
# Invoke-Logging.ps1
$logSettings = $config.Logging.$Effect # when $Effect = 'Warn', looks up 'Warn' → $null
Fix
Rename the config key Warning → Warn to match the Effect enum (the enum is the typed source of truth). Update Configuration.psd1, any user-facing config documentation, and the logging guide example.
Notes
- Also affects
guides/logging.md:80 which uses $config.Logging.Warning.Enabled = $true — a silent no-op
- Found by Sage Nakamura, DualCore, and Shawn Wee!-ler
Summary
The
Effectenum definesWarn. TheConfiguration.psd1Loggingsection uses the keyWarning.Invoke-Logginglooks up$config.Logging.$Effect— whenEffectisWarn, it looks upLogging.Warnwhich doesn't exist. The lookup returns$null, theEnabledcheck fails, and Warn-effect logging is silently skipped every time.Files
Gatekeeper/Private/Invoke-Logging.ps1:14Gatekeeper/Configuration.psd1guides/logging.md:80(also uses the wrong key in the example)Root Cause
Fix
Rename the config key
Warning→Warnto match theEffectenum (the enum is the typed source of truth). UpdateConfiguration.psd1, any user-facing config documentation, and the logging guide example.Notes
guides/logging.md:80which uses$config.Logging.Warning.Enabled = $true— a silent no-op