I probably don't have an exact name for this question, but I'm just learning powershell, and I'm pretty confused as it is now. I have the following situation and I want to know how to view .NET functions (at the end of this question). For example, I have:
System.DirectoryServices.DirectoryEntry
I set this to a variable, for example:
$test = new-object System.DirectoryServices.DirectoryEntry
If I want to get methods for this, I do:
$test | gm
This returns a lot of different names and element types, but I only need the method member, but if I do this:
$test | gm -membertype method
I get no results ... however, if I do
$test.get_children()
it will display the distinguished name and path ... So my question is why, if it is a method, it now displayed when I called GM -membertype method ??
Also, if I do
,$test.get_children() | gm
I get all kinds of different methods, but if I do
$test.get_children() | gm
I get nothing but properties Why doesn't it show methods? I should also note that I was unable to use any of the Membertype methods for ,$test.get_childre() | gm ,$test.get_childre() | gm
It doesn't really matter to me. Can someone explain this and how to determine what I can do with certain .NET functions. Another example might be:
$domain = [System.DirecotryServices.ActiveDirectory.Domain]
How can I navigate this path? Therefore, I would suggest that I should use System. → and see what is available, and select DirectoryServices → and see what is available there.