Export-FormatData

Save formatting data from the current session to a file.

Syntax
      Export-FormatData [-Force] [-IncludeScriptBlock] [-InputObject ExtendedTypeDefinition[]]
         [-NoClobber] [-Path string] [CommonParameters] 

Key:
   -Force
       Overwrite an existing output file, even if the file has the read-only attribute.

   -IncludeScriptBlock
       Include script blocks in the format data exported.
       Because script blocks contain code and can be used maliciously, they are not exported by default.

   -InputObject ExtendedTypeDefinition[]
       The format data objects to be exported.
       Enter a variable that contains the objects or a command that gets the objects,
       such as a Get-FormatData command.
       Objects can also be piped from Get-FormatData to Export-FormatData.

   -NoClobber
       Prevent the cmdlet from overwriting existing files.
       By default, Export-FormatData overwrites files without warning unless
       the file has the read-only attribute.

       To overwrite read-only files, use -Force.

   -Path string
       A location for the output file.
       Enter a path (optional) and filename with a format.ps1xml file extension.
       The default path is the current directory.

       Export-FormatData will overwrite any existing file without warning unless
       the file has the read-only attribute.

       To overwrite read-only files, use -Force.
       To prevent files from being overwritten, use -NoClobber.

   CommonParameters:
       -Verbose, -Debug, -ErrorAction, -ErrorVariable, -WarningAction, -WarningVariable,
       -OutBuffer -OutVariable.

Examples

Export all of the format data in the session to the SS64.format.ps1xml file:

PS C:> get-formatdata -typename * | export-formatdata -path SS64.format.ps1xml -IncludeScriptBlock

Export the format data for the HelpInfoShort type to the Help.format.ps1xml file:

PS C:> $fdat = get-formatdata -typename helpinfoshort
PS C:> export-formatdata -inputObject $fdat -path E:\help.format.ps1xml -IncludeScriptBlock

“Successful people are successful because they form the habits of doing those things that failures don't like to do” ~ Albert Gray

Related:

Get-FormatData - Get the formatting data in the current session


© Copyright SS64.com 1999-2014
Some rights reserved