Decorating PowerShell Objects
Ever wonder how PowerShell seems to know how to format objects? When you run
Get-ChildItem or
Get-WmiObject , you only see a few key properties, but a wealth of other information is available through commands like
Select-Object and
Get-Member .
Have you ever written a PowerShell function that you nearly always pipe to
Format-Table ? Wouldn’t it be nice to specify some default properties and force them into a table?
Stop by for a quick hit on how to decorate your PowerShell objects with type names and formatting, including a re-usable tool to abstract out some of the details.
Cheers!
Related Articles
A Microsoft 365 Incident Should Not Start With Twelve Disconnected Scripts
A compromised Microsoft 365 account rarely stays inside one administrative surface. Sign-ins live in Microsoft Entra ID. …
Read moreFind What Wakes a Windows PC With Get-WinEvent
A PC that turns itself on at night leaves a record in the System log every time it does. Windows writes one event when the PC …
Read moreFind Free Azure CIDR Blocks with PowerShell
Suppose the network team assigns 10.172.0.0/16 to an Azure landing zone. You need to divide it into correctly aligned virtual …
Read more