Exporting reports to CSV files

If your boss asks for a report, he probably wants it in the form of a spreadsheet. The easiest way to create a spreadsheet from a PowerCLI report is to export it to a CSV file. This CSV file can be imported in a spreadsheet. Another use case for CSV files is creating export files of one system that you can use later to import into another system. For example, you can use CSV files to export the settings of vCenter Server and import them in another vCenter Server. PowerShell contains the Export-CSV cmdlet to create CSV files.

The syntax of the Export-CSV cmdlet is as follows:

Export-Csv [[-Path] <String>] [[-Delimiter] <Char>] [-Append] [-Encoding <String>] [-Force] [-LiteralPath <String>] [-NoClobber] [-NoTypeInformation] ...

Get Learning PowerCLI now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.