PowerShell Genie

Microsoft.PowerShell.Utility module: setup and commands

Module 2 min read Windows PowerShell 5.1 and PowerShell 7

Documentation: Microsoft Learn

Transform, measure, sort and export objects with Utility cmdlets while keeping formatting commands at the end of the pipeline.

Getting it

Ships with PowerShell everywhere and loads automatically at startup.

Examples

1PS> Get-Process | Where-Object CPU -gt 20
Show reference output
1 Name ProcessName Id CPU WS
2 ------- ----------- ---- ------ ---------
3 chrome chrome 9184 842.31 486539264
4 MsMpEng MsMpEng 2600 950 220200960
1PS> [pscustomobject]@{Server= $env:COMPUTERNAME;Checked= Get-Date } | ConvertTo-Json
Show reference output
1 {
2 "Server": "SRV01",
3 "Status": "Healthy",
4 "Checked": "2026-09-10T22:31:00+05:30"
5 }

What it is for

Use it once data is already in hand and needs to be reduced, reordered, or written out. It is also where a report object gets built through Select-Object calculated properties, and where two collections get compared with Compare-Object.

Typical tasks

  • Pick and rename properties for a report
  • Group and count records by a field
  • Export results to CSV or JSON
  • Compare two collections for drift
  • Time an operation with Measure-Command
  • Emit diagnostic text through Write-Verbose

Check the installed version

1PS> Get-Module -ListAvailable Microsoft.PowerShell.Utility | Select-Object Name, Version, Path
2PS> Get-Command -Module Microsoft.PowerShell.Utility

Compare the module path and version with the session used by your scheduled task or automation account. Use it once data is already in hand and needs to be reduced, reordered, or written out. It is also where a report object gets built through Select-Object calculated properties, and where two collections get compared with Compare-Object.

Primary documentation

Export-Csv reference · ConvertTo-Json reference · Where-Object reference

Continue
Genie guideMicrosoft.PowerShell.Utility module: setup and commands

Transform, measure, sort and export objects with Utility cmdlets while keeping formatting commands at the end of the pipeline.