function ExportToExcel{ param ( $GetPCArray ) $timestamp = get-date -Format "MMddhhmmssms" $outfile = "$env:TMP\getpcoutput$timestamp.csv" $GetPCArray | Export-Csv $outfile -NoTypeInformation Invoke-Item $outfile }