You are here:

WindowsManagement.com > PowerShell > PowerShell 1.0 > Export-Clixml
ActiveXperts Network Monitor 2019 proactively manages network servers, devices, databases and more.

Export-Clixml - PowerShell 1.0

Microsoft Windows PowerShell is a command-line shell and scripting tool based on the Microsoft .NET Framework. It is designed for system administrators, engineers and developers to control and automate the administration of Windows and applications.

More than hundred command-line tools (so called "cmdlets") can be used to perform system administration tasks and Windows Management Instrumentation (WMI). These cmdlets are easy to use, with standard naming conventions and common parameters, and standard tools for piping, sorting, filtering, and formatting data and objects.

Export-Clixml


Description
Back up your Hyper-V VMs Easy & Fast. 100% built for Hyper-V. Free for 2 VMs, forever.

Usage


Options
-Path string
        The XML file to be created.

   -inputObject psobject
        The object to be converted. {may be piped}
        A variable containing the object(s) 
        or a command/expression that returns the object(s).

   -depth int 
        How many levels of contained objects to include in the XML
        A depth of 1 will include Object > properties
        a depth of 2 will include Object > properties >Objects >Properties
        and so on *

   -force
       Override restrictions that prevent the command from succeeding, apart
       from security settings. e.g. Force will override a files read-only attribute,
       but will attempt to reset the read-only attribute when the command completes.
	   
    -noClobber
       Do not overwrite the contents of an existing file.
       The default is to overwrite without warning.
		 
    -encoding string
       The type of encoding for the target file. Valid values are:
       ASCII, UTF8, UTF7, UTF32, Unicode, BigEndianUnicode, Default, and OEM.
        
   -whatIf
       Describe what would happen if you executed the command without actually
       executing the command.
       
   -confirm
       Prompt for confirmation before executing the command.
 
   CommonParameters:
        -Verbose, -Debug,-ErrorAction,-ErrorVariable, -OutVariable.

Example(s)
Creates an XML file that represents the string, "This text will become XML"

PS C:>"This text will become XML" | export-clixml c:\SimpleDemo.xml

Use Get-Acl to retrieve an object containg the ACLs (security descriptors) for a file, and pipe the result into an XML file.

PS C:>get-acl C:\ss64.txt | export-clixml -Path E:\ss64_acl.xml

Retrieve the ACL object from a saved XML file and store in the variable $var_ss64_acl:

PS C:>$var_ss64_acl = import-clixml E:\ss64_acl.xml