Can someone explain like I’m five the difference between those 2 commands:
1- Get-ChildItem | Get-Member
2- Get-Member -inputObject Get-ChildItem
The results of the commands are not the same.
Command1 output TypeName: System.IO.DirectoryInfo properties and methods of Get-ChildItem objects.
Command2 output TypeName: System.String
Then I tried to get more information via help :
Get-Help Get-Member -parameter inputObject
Specifies the object whose members are retrieved.
Using the InputObject parameter is not the same as piping an object to Get-Member. The differences are as follows: -- When you pipe a collection of objects to Get-Member, Get-Member gets the members of the individual objects in the collection, such as the properties of each string in an array of strings. -- When you use InputObject to submit a collection of objects, Get-Member gets the members of the collection, such as the properties of the array in an array of strings.
This is Chinese for me … I don’t get it.