I was trying to get all the string properties and methods. And instead of >”1,2,3,4,5,6″ | Get-Member just out of curiosity I tried the following command and it gives me the Length property of String object. I thought it will give me error or no output. Any idea why it is doing this? Or How PowerShell interprets SELECT command?
PS C:>"1,2,3,4,5,6" | SELECT *
Length
-----------
11
Lengthis the only property ofSystem.Stringthe rest of the members are methods. You can see this by doing:Selectis an alias forSelect-Object.Select-Object -Property *says list all properties and property values of the incoming object.You can see all the members of
System.Stringhere and read up on theSelect-Objectcmdlet here.