Skip to content

Commit 5610581

Browse files
fix: quiet module load log (Verbose instead of Information) (#470)
## Summary Closes #458. The `Plaster vX.Y.Z module loaded successfully (...)` line printed on **every** import because it was logged at `Information` level via `Write-Information -InformationAction Continue`, which forces display regardless of `$env:PLASTER_LOG_LEVEL`. This demotes that message — and the symmetric `Plaster module is being removed` message — to `Verbose`. They are now silent by default and only surface when a user opts in with `PLASTER_LOG_LEVEL=Verbose` (and a visible verbose stream). The version is already read dynamically from the manifest (`Import-PowerShellDataFile … .ModuleVersion`), so the message prints the correct installed version (e.g. `v2.1.2`). The reporter saw `v2.0.0` only because that was their installed build. ## Changes - `Plaster/Plaster.psm1`: `Write-PlasterLog -Level Information` → `-Level Verbose` for both the load and removal messages. ## Testing - `Import-Module Plaster` — no output (silent). ✅ - `$env:PLASTER_LOG_LEVEL='Verbose'; $VerbosePreference='Continue'; Import-Module Plaster -Force` — emits `[Verbose] [Plaster] Plaster v2.1.2 module loaded successfully (PowerShell 7.6.2)`. ✅ 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent ff47c2d commit 5610581

3 files changed

Lines changed: 15 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,20 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10-
## [2.1.2] - 2026-05-26
10+
## [2.1.3] - 2026-06-18
1111

12-
### Changed
12+
### Fixed
1313

14-
- CI workflows migrated to PowerShellOrg reusable CI and release
15-
workflows ([#457](https://github.com/PowerShellOrg/Plaster/pull/457))
14+
- `Import-Module Plaster` printed `Plaster vX.Y.Z module loaded
15+
successfully` on every import — the message was logged at
16+
`Information` level with `-InformationAction Continue`, so it
17+
displayed regardless of `$env:PLASTER_LOG_LEVEL`. Demoted it (and the
18+
symmetric "module is being removed" message) to `Verbose` so they are
19+
silent by default and surface only when `PLASTER_LOG_LEVEL=Verbose`
20+
([#470](https://github.com/PowerShellOrg/Plaster/pull/470),
21+
closes [#458](https://github.com/PowerShellOrg/Plaster/issues/458))
22+
23+
## [2.1.2] - 2026-05-26
1624

1725
### Fixed
1826

Plaster/Plaster.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
GUID = 'cfce3c5e-402f-412a-a83a-7b7ee9832ff4'
77

88
# Version number of this module.
9-
ModuleVersion = '2.1.2'
9+
ModuleVersion = '2.1.3'
1010

1111
# Supported PSEditions
1212
CompatiblePSEditions = @('Desktop', 'Core')

Plaster/Plaster.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ Export-ModuleMember -Variable @('TargetNamespace', 'DefaultEncoding', 'JsonSchem
177177

178178
# Module cleanup on removal
179179
$MyInvocation.MyCommand.ScriptBlock.Module.OnRemove = {
180-
Write-PlasterLog -Level Information -Message "Plaster module is being removed"
180+
Write-PlasterLog -Level Verbose -Message "Plaster module is being removed"
181181

182182
# Clean up any module-scoped variables or resources
183183
Remove-Variable -Name 'PlasterVersion' -Scope Script -ErrorAction SilentlyContinue
@@ -188,4 +188,4 @@ $MyInvocation.MyCommand.ScriptBlock.Module.OnRemove = {
188188
}
189189

190190
# Module initialization complete
191-
Write-PlasterLog -Level Information -Message "Plaster v$PlasterVersion module loaded successfully (PowerShell $($PSVersionTable.PSVersion))"
191+
Write-PlasterLog -Level Verbose -Message "Plaster v$PlasterVersion module loaded successfully (PowerShell $($PSVersionTable.PSVersion))"

0 commit comments

Comments
 (0)