A colleague of mine sent me an email asking if I could explain what he sees in his console:
You might be interested in as well so here are the answers:
For the 1rst screenshot, it’s the Intellisense feature that proposes this list of values that the MemberType parameter accepts.
If you use the help either online or interactively, you can’t unfortunately find the answer.
As you can see the help on PowerShell 5.0 doesn’t really help.
I knew the answer and replied that property is actually an alias of the properties parametername.
Yes, parameters can have aliases 🙂
To uncover it, you should use the Get-Command cmdlet:
(gcm Get-ADUser | Select -Expand Parameters)['Properties']
And when I tested on PowerShell 5.1, it appears that the alias is displayed
First mistery solved 😀
Now the 2nd one. Why there’s a difference in the count?
Can you notice the addtional “Select * ” in the second command invocation ?
Well, using the Select-Object cmdlet changes an object, including its type, methods and properties.
To find out what are the exact differences, you can do
$User = 'A random UserName' Compare-Object (Get-ADUser $User -Pro *| gm).Name -Diff (Get-ADUser $User -Pro *| select *| gm).Name
The native ADUser object has a Contains and GetEnumerator methods, a Item ParameterizedProperty whereas its “Selected” ADuser doesn’t…
2nd Mystery solved 😎