July 2018
Beginner
552 pages
13h 18m
English
The Export-Clixml cmdlet can be used to serialize objects to file, which can then be easily deserialized with Import-Clixml. Serialization is the process of exporting objects to a file or data format with its specific type information. It is similar to the techniques we learned earlier, except that it keeps the type information with it:
#Defining file for export$exportedFile = 'C:\temp\exportedProcesses.xml'#Exporting services and strong into variableGet-Process| Tee-Object -Variable exportedProcesses | Export-Clixml $exportedFile #Showing variable$exportedProcesses#Importing services$importedProcesses = Import-Clixml $exportedFile#Comparing objects - no difference should be visibleCompare-Object -ReferenceObject $exportedProcesses ...
Read now
Unlock full access