Data Infrastructure Management Software Discussions

Need PowerShell Help With Contents in Brackets {}


I've created Powershell scripts to export CIFS shares, iSCSI LUN mappings, and network information to CSV files. Those files are copied to a DR server so we will have configuration information available in a disaster.


This works well, however there are a few fields that don't transfer data to the spreadsheet. Specifically, fields that enclose data in brackets {}.


Here's an example: the command for exporting the list of subnets to a spreadsheet.

Get-NcNetSubnet -Controller $CLUSTER | select SubnetName,Subnet,Gateway,IPRanges | Export-Csv subnets.csv


When I run the command without the Export-Csv, the "IPRanges" field shows up like this in PowerShell:



With Export-Csv, it exports the results for this field like this:



I get similar results when I list network interfaces. The "DataProtocols" field encloses the results in {} which shows up wrong on the spreadsheet.


Has anyone run across this behavior? Is there a solution? Thanks in advance!


Re: Need PowerShell Help With Contents in Brackets {}

didn't look exactly on your case - i guess it's


Just to share that the way i do this type of export-import is with





And then on the other site





That gives very consistent data structure. and will also work with simple pipe sometimes.($Quota | Set-ncQuota)


i prefer the  CLIXML options. but they should both work just the same.




Gidi Marcus (Linkedin) - Storage and Microsoft technologies consultant - Hydro IT LTD - UK

View solution in original post

Re: Need PowerShell Help With Contents in Brackets {}

Thank you @GidonMarcus! The link gave me just what I needed.

Cloud Volumes ONTAP
Review Banner
All Community Forums