Creating Excel Reports from PowerShell Data

by Nov 22, 2011

Provided you have Microsoft Excel installed, here is a clever function that you can use to convert PowerShell results into Excel spreadsheets:

function Out-ReportExcel {
 param(
  $Path = "$env:temp\report$(Get-Date -format yyyyMMddHHmmss).csv",
  [switch]$Open
 )

 $Input | 
  Export-Csv $Path -NoTypeInformation -UseCulture -Encoding UTF8

  if($Open) { Invoke-Item $Path }
}

Simply try it:

Get-Process | Out-ReportExcel -Open

Twitter This Tip!
ReTweet this Tip!