I am attempting to use PS to import a list of IP address subnets (with individual, corresponding, site names) from CSV and for each of them, create additional items and then export the result to another CSV.
In the import CSV there are two columns, “Site Name” and “IP Address” e.g.
I’d like to use PS to ultimately output a separate (one column) CSV containing something along the lines of the following:
ConnectionName; ConnectionAddress; FolderName
Test1 Host1; 188.8.131.52; Test1 Host1
Test1 Host2; 184.108.40.206; Test1 Host2
Test1 Host3; 220.127.116.11; Test1 Host3
Test2 Host1; 18.104.22.168; Test2 Host1
Test2 Host2; 22.214.171.124; Test2 Host2
Test2 Host3; 126.96.36.199; Test2 Host3
Test3 Host1; 188.8.131.52; Test3 Host1
Test3 Host2; 184.108.40.206; Test3 Host2
Test3 Host3; 220.127.116.11; Test3 Host3
The idea being that the output CSV can be read by a system in order to create a hierarchy.
I’m aware (roughly) I’m looking at using “import-csv”, “foreach” and, I’m assuming, “new-item” but I’m not entirely sure how to put it all together.
If anyone could point me in the right direction I’d appreciate it.