PowerShell - Export-Csv versus Export-Clixml
1 min read · Updated 5 September 2024
Export-Csv is handy because it allows you to export and use the export in a spreadsheet like Excel or in PowerShell with Import-Csv.
The generated file also has the advantage of being readable.
# ExampleGet-Process | Select-Object -Property name,cpu,path | Export-Csv -Path c:\process.csv
# Display the contents of the fileGet-Content -Path c:\process.csv
# Import the CSVImport-Csv -Path C:\process.csvBut Export-Csv falls short under certain conditions.

Get-Service | Select-Object -Property name,dependentservices | Export-Csv -Path c:\demo.csv
# Display the contents of the fileGet-Content -Path c:\demo.csv
# Import the CSVImport-Csv -Path C:\demo.csv
# Display the type of the dependentservices property(Get-Service).dependentservices.GetType()The problem is that Export-Csv doesn’t know how to handle array properties (represented between braces).
If you want to export and import your objects in this context, it’s better to use Export-Clixml.

Get-Service | Select-Object -Property name,dependentservices | Export-Clixml -Path c:\process.xml
# Display the contents of the fileGet-Content -Path c:\process.xml
# Import the xml fileImport-Clixml -Path C:\process.xmlUnfortunately, it is no longer possible to use the file directly in a spreadsheet, and the generated file is difficult to read.
Related links
- PowerShell
PowerShell - Simply send objects to different variables
PowerShell - Tip - Simply send objects to different variables
1 min read
- PowerShell
Test-Connection and Test-NetConnection
Ping with Test-Connection (ping count, boolean result, remote pings over WinRM) and check SMB, HTTP or RDP ports with Test-NetConnection.
2 min read
- PowerShell
PowerShell - Display network connections (equivalent to netstat)
Display network connections (listening ports, active connections...)
2 min read
- PowerShell
PowerShell - Testing name resolution (equivalent to nslookup)
PowerShell commands to test name resolution (equivalent to nslookup)
2 min read
- PowerShell
PowerShell - View and manage DNS configuration of network interfaces
PowerShell commands to display and manage DNS configuration of network interfaces
4 min read
- PowerShell
PowerShell - Managing IP configuration of network interfaces
PowerShell commands to view and modify the IP configuration of network interfaces
4 min read
New site · Reference
The Windows directory tree
Native Windows folders, files and logs: what they are for, what they contain, with commands and Microsoft sources.
Browse the treeNew site · Reference
Group Policy settings
ADMX settings for Windows 10, 11, Server and applications: registry keys, PowerShell commands and use cases.
Browse the policies