Imports a CLIXML file and creates corresponding objects within Windows PowerShell.

Syntax

Import-Clixml [-Path] <string[]> [<CommonParameters>]

Description

The Import-Clixml cmdlet imports a CLIXML file with data that represents Microsoft .NET Framework objects and creates the objects in Windows PowerShell.

Parameters

-Path <string[]>

Specifies the location of the XML files to be converted into Windows PowerShell objects.

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.

Inputs and Outputs

The input type is the type of the objects that you can pipe to the cmdlet. The return type is the type of the objects that the cmdlet returns.

Inputs

System.String

You can pipe a string that contains a path to Import-Clixml.

Outputs

PSObjects

Import-Clixml returns objects that have been deserialized from the stored XML files.

Notes

When specifying multiple values for a parameter, use commas to separate the values. For example, "<parameter-name> <value1>, <value2>".

Example 1

C:\PS>get-process | export-clixml pi.xml

C:\PS> $processes = import-clixml pi.xml

This command uses the Export-Clixml cmdlet to save a serialized copy of the process information returned by Get-Process. It then uses Import-Clixml to retrieve the contents of the serialized file and re-create an object that is stored in the $processes variable.









Table Of Contents