I'm kind of new to PowerShell. Currently I'm trying to get columns from abd excel files and stock them into a new CSV file.
I managed to get the columns I needed from the excel using this:
$emails=$file.Worksheets['Form1'].UsedRange.Rows.Columns[4].Value2
$Response=$file.Worksheets['Form1'].UsedRange.Rows.Columns[8].Value2
Where $emails $Response
are System.array
containing
email1
...
email 20
and
Resp1 ...
Resp20
However I didn't mange to get this format :
Email , Response
----------------
email1, Resp1
Email2, Resp2
Instead by applying [pscustomobject]@{'emails' = $emails; 'Response' = $Response}
I get sth like this:
emails Response
--- ---
{Email1, email2 ... email20} {Resp1..Resp20}
Can anyone one help me with this ? Thank you very much !!