construct variable for export-csv
1 TopicHow construct a variable that works with export-csv?
Hello, I have a small csv file that I import in Powershell into a variable. Here it is (as I can't seem to upload a file): "RGG","BAS","IMT" "keepass","webex","firefox" "acrobat","ciscoany","teams" "","keepass","Visio" "","Acrobat","Project" "","gekkotArt","" After importing it I can examine $myCsvVar in many ways. For example: $myCsvVar= Import-Csv -Path C:\temp\csvFile.csv -Delimiter "," $myCsvVar $myCsvVar.RGG $myCsvVar.RGG[1] $myCsvVar[1] $myCsvVar[1,2] $myCsvVar.gettype() $myCsvVar.RGG.gettype() $myCsvVar[1].gettype() $myCsvVar|get-member However hard I try, I am not able to create such a variable from within Powershell. Would anybody here know how to do that? The reason is that I have to construct a variable as an object that I then can use with export-csv. Thank you.14KViews0likes3Comments