Using the useful powershell module importExcel
I could use this to import folder with csv-files to a excelfil for more easy viewing for common users.
Use commented install-module line for first run.
References: https://github.com/dfinke/ImportExcelThis file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
#Install-Module ImportExcel -scope CurrentUser Import-Module importexcel $inputFilePath = "C:\temp\csvFiles" $outputFilePath = "C:\temp\csvFiles\myExcel.xlsx" $files = get-childitem -Path $inputFilePath -Filter "*.csv" #|select -First 1 if (Test-Path $outputFilePath) { Remove-Item -Path $outputFilePath -Force } foreach ($file in $files) { #for files with naming standard myfile_sheetname.csv $sheetName = $file.name.split("_")[-1].split(".")[0] write-output "exporting $($file.name)..." $collection = import-csv -Path $file.FullName $collection |export-excel -Path $outputFilePath -WorksheetName $sheetName -AutoSize -TableName $sheetName }