I would like to use export-csv in a simple script listing the machine name and all of its custom attributes. I have tried a couple of ways, but they list the server name 8 times, with the annotation and the value next to it, not very usable for the way I need to use it.
I'd like it to look something like this.
Server Owner BuiltBy
-------- -------- ----------
server1 doug bill
server2 Mike stan
ty!
Try like this
$obj = [ordered]@{
VM = $_.Name
}
$_.Group | %{
$obj.Add($_.Name,$_.Value)
}
New-Object PSObject -Property $obj
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try like this
$obj = [ordered]@{
VM = $_.Name
}
$_.Group | %{
$obj.Add($_.Name,$_.Value)
}
New-Object PSObject -Property $obj
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thank you so very much again!