Hi assuming this is your csv file "name","ip","netmask","gateway","dns","networkName" "TESTSRV1","10.244.186.136","255.255.255.0","10.244.186.1","10.244.37.25;10.244.37.26","VLAN1...
See more...
Hi assuming this is your csv file "name","ip","netmask","gateway","dns","networkName" "TESTSRV1","10.244.186.136","255.255.255.0","10.244.186.1","10.244.37.25;10.244.37.26","VLAN186_QA" you have one problem. You can't save any arrays into a csv and make powershell recognize them natively. Instead, use a custom delimiter (not the same as csv uses!) and split them - at import - into an array. Look at the semicolon between the two dns servers. $newVmList = Import-Csv test.csv | Select-Object -Property "name", "ip", "netmask", "gateway", @{Name = "dns"; Expression = {$_.dns -split ";"} }, "networkName" The resulting object looks like this name : TESTSRV1 ip : 10.244.186.136 netmask : 255.255.255.0 gateway : 10.244.186.1 dns : {10.244.37.25, 10.244.37.26} <-- Array networkName: VLAN186_QA Regards Emanuel