Painlessly Get Data from PowerShell to Excel

Currently, there are a couple of ways (painful ways) to get data from PowerShell to Excel. You can do it using  the COM (Component Object Model) interface:

Then create a workbook, a sheet, get access to the sheet cells, loop over the data copying each property of each object to the correct row or column.

Or, you can use Export-Csv on the data, and Invoke-Item on the file to launch Excel.

Viable options for sure.

Buy What If

You wanted to create an Excel spreadsheet, without Excel being installed? Like on a server. Create Pivot tables, charts. Or import and Excel spreadsheet, do something to it and export it again. What if you wanted to take all the sheets in a an Excel workbook and create each one as a text file for use elsewhere?

Well, that’s what my new PowerShell Excel Module makes easy.

In Action

Here is how you can export all the process info from a box, to Excel, without Excel.

With Charts!

Adding a few more switches in Export-Excel, you create a pivot table (By Company, summing Physical Memory) and include a chart.

See The Result

Using the –Show switch, will launch Excel on the newly created file. Here is what you get, data, pivoted data and charts!

image

Get the module and get the updates as it moves forward here on GitHub. and on the PowerShell Gallery.