Powershell output formatting
I'm assuming you're using PowerShell 2.0.
If your module is called MyModule
, you can create a MyModule.Format.ps1xml
file alongside it to describe what properties are displayed by default by Format-List
, Format-Table
, etc. See Get-Help about_Format.ps1xml
and Formatting File Overview for more information.
To link your formatting file to your module, you would create a module manifest and define the FormatsToProcess
item. The New-ModuleManifest
cmdlet can get you started with this.