Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Can you explain this hashtable?

$
0
0

Hi,

I understand the basic principle of powershell hashtables but there are elements of this one that I was hoping you can explain;

@{name="MemberOf";expression={$_.memberof -join "`n"}}

I don’t understand what the –join operator is used for and what "`n" is?

The full command;

$Users = get-aduser -filter *  -SearchBase 'ou=users,dc=mydomain,dc=local' -properties memberof

 

$Users.MemberOf.ToString()

 

$Users | Select-Object GivenName,Surname,SamAccountName,@{name="MemberOf";expression={$_.memberof -join "`n"}} |Export-CSV c:\temp\MemberOf.csv -NoTypeInformation

 Thanks.

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles