I'm trying to convert the output of a powershell (AWS Tools) command to strings so that I can export them to CSV or HTML. I for the life of me can't figure it out. I've seen comments on hashtables, naming elements, etc. Nothing seems to help me. (I'm very much a newbie).
This is what I got. This command
(Get-IAMAccountAuthorizationDetail).UserDetailList | Select UserName, Grouplist
Will output this (with better spacing):
UserName GroupList
-------- ---------
User1 {Admins,Test}
User2 {Admins}
I cant' seem to figure out how to get this data so that it can be converted to CSV or HTML. Those brackets are an indication its an object, array or something. Can someone show me the code that would convert this to text or something that the Convertto-CVS o Convertto-HTML commands would work.
The output (subset) of the Get-Member
Command is this:
TypeName : Amazon.IdentityManagement.Model.UserDetail Name : Equals MemberType : Method Definition : bool Equals(System.Object obj)
TypeName : Amazon.IdentityManagement.Model.UserDetail Name : GetHashCode MemberType : Method Definition : int GetHashCode()
TypeName : Amazon.IdentityManagement.Model.UserDetail Name : GroupList MemberType : Property Definition : System.Collections.Generic.List[string] GroupList {get;set;}
Thanks