Tuesday, January 20, 2009

export and import processes by using a variable

step 1) PS> $p = get-process

step 2) Now write the variable to a CSV file and a CliXML file:
PS> $p | export-CSV .\test.csv
PS> $p | export-CliXML .\test.xml

step 3) Now import these values into two new variables:
PS> $p1 = import-csv .\test.csv
PS> $p2 = import-CliXML .\test.xml

step 4) To view their output from these variables:
PS> $p1 <----------- in a list format
PS> $p2 <----------- in a tabular format

No comments:

Post a Comment