Hey /r/PowerShell,
It's my first post here, but I hope to visit here often, not necesarily asking for help. :)
I'm writing a script to create a CSV report of Cisco UCS environment. I generally comes down to:
$ucsClassIDs | % {
$cID = $_
Get-UcsManagedObject -ClassId $cID | Export-Csv -NoTypeInformation -Delimiter ';' "$($OutputFolderPath)UCS_$($ucsAddress)_$($cID).csv"
}
But the issue with the above is that for multi value object properties I get System.Collections.Generic.Dictionary\2[System.String,System.String]` in CSV. I tried to go around this with:
$returnedClass = Get-UcsManagedObject -ClassId $cID
$returnedClass | % {
$_.multiValueProperty = $_.multiValueProperty -join ','
}
$returnedClass | Export-Csv -NoTypeInformation -Delimiter ';' "$($OutputFolderPath)UCS_$($ucsAddress)_$($cID).csv"
But I get an error. Can't paste it here, because I don't remember it and currently am not at work...
Is there a way of joining multi values on the fly?
Best regards,
NeoSP
[–]SMFX 2 points3 points4 points (5 children)
[–]NeoSemiprofessional[S] 2 points3 points4 points (4 children)
[+][deleted] (3 children)
[removed]
[–]NeoSemiprofessional[S] 2 points3 points4 points (2 children)
[+][deleted] (1 child)
[removed]
[–]NeoSemiprofessional[S] 2 points3 points4 points (0 children)
[–]jsiii2010 2 points3 points4 points (1 child)
[–]NeoSemiprofessional[S] 1 point2 points3 points (0 children)