Going through your posted code, you have a few extra closing curly braces "}" so I'm just guessing at where you are in the code. One thing that I have noticed since your desired output is to a CSV, we need to make sure that each logical disk has its properties listing in the PowerShell pipeline. We could send the entire contents to the pipeline, but in a CSV you will see your data listed as System.Object[] if you opened it in Excel. If your intent is to view this in Excel, that would be bad. If I'm heading in the wrong direction, please let me know and I'll see what I can do to help.

I rewrote your code. I hope I did not cannibalized it to the point that it is not useful to you. I left it as the function that I used to test, but you can copy and paste out what you need.

# The $Index will prevent the creation of Property names of the # same type. Since the designed output is to a CSV, we need # to not save an object inside of an object or the CSV will not # have the designed data.

$Index = 0

# Create a property for each property of the logical disk that # needs to be in the output. Take note of how the $Index value # is used in the -Name parameter. ForEach ($Disk in $LDisk) { $Obj | Add-Member -MemberType NoteProperty ` -Name "DeviceID_$Index" ` -Value $Disk.DeviceID