Export (0) Print
Expand All

Import-Clixml

Published: February 29, 2012

Updated: August 15, 2012

Applies To: Windows PowerShell 2.0, Windows PowerShell 3.0

Import-Clixml

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

Syntax

Parameter Set: ByPath
Import-Clixml [-Path] <String[]> [-First] [-Skip] [-IncludeTotalCount] [ <CommonParameters>]

Parameter Set: ByLiteralPath
Import-Clixml -LiteralPath <String[]> [-First] [-Skip] [-IncludeTotalCount] [ <CommonParameters>]




Detailed 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 XML files.


Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-LiteralPath<String[]>

Specifies the XML files. Unlike Path, the value of the LiteralPath parameter is used exactly as it is typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose it in single quotation marks. Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-First

Gets only the specified number of objects. Enter the number of objects to get.


Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Skip

Ignores the specified number of objects and then gets the remaining objects. Enter the number of objects to skip.


Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-IncludeTotalCount

Reports the total number of objects in the data set (an integer) followed by the selected objects. If the cmdlet cannot determine the total count, it displays "Unknown total count." The integer has an Accuracy property that indicates the reliability of the total count value. The value of Accuracy ranges from 0.0 to 1.0 where 0.0 means that the cmdlet could not count the objects, 1.0 means that the count is exact, and a value between 0.0 and 1.0 indicates an increasingly reliable estimate.


Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see  about_CommonParameters (http://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

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

  • System.String

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


Outputs

The output type is the type of the objects that the cmdlet emits.

  • PSObject

    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>".

Examples

-------------------------- EXAMPLE 1 --------------------------

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.


PS C:\> get-process | export-clixml pi.xml
PS C:\>$processes = import-clixml pi.xml



Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft