Behind the PowerShell Pipeline logo

Behind the PowerShell Pipeline

Subscribe
Archives
October 19, 2023

Can I Get Some Help

Recently, I posted an article about using localized data in your function’s messages. My reasoning is that I want to have a consistent user experience across all functions in my module. I also took this concept and applied it to how I was displaying messages, specifically verbose output.

In my functions, I typically use verbose statements like this:

Write-Verbose "[$((Get-Date).TimeOfDay)] BEGIN  ] Starting $(MyInvocation.MyCommand)"

My verbose statements tend to be structured with some prefix, like the time an indicator; I often display the function script block like Begin and a message. This gets to be repetitive in my code. And what if I want to change the layout? I don’t want to be forced to update all the functions in my module.

Want to read the full issue?
GitHub Bluesky LinkedIn About Jeff
Powered by Buttondown, the easiest way to start and grow your newsletter.