PowerShell 2.0: One Cmdlet at a Time 88 Export-FormatData

Continuing the series looking at new cmdlets available in PowerShell 2.0. This time we look at the Export-FormatData cmdlet.

What can I do with it?

Take formatting data generated by Get-FormatData and export it to a *.ps1xml file.

Example:

Retrieve the formatting for the TypeName Microsoft.Win32.RegistryKey and export it to a *.ps1xml file.

Get-FormatData -TypeName Microsoft.Win32.RegistryKey | Export-FormatData -Path registryformat.ps1xml -IncludeScriptBlock

The contents of registryformat.ps1xml are shown below.

How could I have done this in PowerShell 1.0?

You would have needed to manually create your own *.ps1xml files.

1000 things 1% better!