Opening Results in Excel

by Aug 23, 2011

To send PowerShell results to Excel, you can use CSV-files and automate the entire process by using this function:

function Out-Excel($path="$env:temp\$(Get-Date -format 'yyyyMMddHHmmss').csv") { $input | Export-Csv $path -UseCulture -Encoding UTF8 -NoTypeInformation Invoke-Item $path }

Once you ran the function, you can use it like this:

Get-Process | Out-Excel
Get-WmiObject Win32_BIOS | Out-Excel

Twitter This Tip!
ReTweet this Tip!