Hi :) I'm still struggling with my program and still trying to learn new techniques with PowerShell. Now, I'm going to use Import-Excel and I'm trying to get the KEY and VALUE of File_1.xlsx from the "L6 and M6" Column then compile its value with a comma inside a cell where the Key name is the same.
Just like this sample image here:

but first, I want to Know how to get the Columns for L and M and just figure out the rest:
- Get all the Input Files (I have multiple Input Files and Worksheets)
- Get the Key and Value from L and M Column
- Compile all Value with the Same Key names
- Convert it to CSV
I'm following the solution by Sir Santiago, but I can't get the L and M Column How to export a specific Excel column with PowerShell?
$Source = "C:\PS"
$Output = 'C:\Out\Output.csv'
$Files = GCI "$Source"
ForEach ($File in $Files) {
$Data = @'
Key, $File.Name
$_Key, $_Value
'@
}
$Data | Export-Excel $Output
Import-Excel $Output -ImportColumns 12, 13 -HeaderName Key, $File.Name -DataOnly
Or am I getting the idea Wrong? Sorry for asking this multiple times, just can't get the right thing to do this.