PSWriteMessage

2026.8.26

Write-Message is a drop-in replacement for the builtin Write-* cmdlets: it timestamps every message, formats it by type (Debug, Verbose, Info, Success, Warning, Error) with ANSI color and a type prefix, and can optionally tee the message to a log file.

Minimum PowerShell version

5.1

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Module -Name PSWriteMessage

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

Install-PSResource -Name PSWriteMessage

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

(c) 2024-2026 William Quinn. Licensed under the MIT License.

Package Details

Author(s)

  • William Quinn

Tags

Logging Console Write-Host ANSI PSStyle

Functions

Write-Message

Dependencies

This module has no dependencies.

Release Notes

2026.08.26

Changed:
- BREAKING: Write-Message no longer writes to the success stream. Output now
 goes to the host via Write-Host (information stream 6), so log lines can no
 longer contaminate a function's return value or a captured pipeline. Callers
 that captured the string ($x = Write-Message ...) now get $null; use 6>&1 or
 -OutFile to capture the text. OutputType is now [void].
- Debug/Verbose messages show for any effective preference other than
 SilentlyContinue (was: only Continue), matching the built-in Write-Verbose /
 Write-Debug. This makes -Debug work on Windows PowerShell 5.1, where the
 switch sets $DebugPreference to Inquire rather than Continue.

Fixed:
- -Verbose / -Debug passed to an ancestor function in another module or script
 is now honored; the effective preference is resolved from the caller's scope
 instead of the module's own.

Full changelog: https://github.com/youvegotwq/PSWriteMessage/blob/main/CHANGELOG.md

FileList

Version History

Version Downloads Last updated
2026.8.26 (current version) 5 8/27/2026
2026.8.21 5 8/26/2026