pstypenames

http://app.en25.com/e/es.aspx?s=1403&e=4513&elq=5704846539654ee18e58b4d31d7fb3ff

concerns the "hidden" property named pstypenames .
(Hidden in the sense that GetMember requires -Force to disclose it.)

For example:

   PS C:> $a = 'Hello'
   PS C:> $a.pstypenames
   System.String
   System.Object

   PS C:> $a = 1
   PS C:> $a.pstypenames
   System.Int32
   System.ValueType
   System.Object

   PS C:> $a = 1,2,3
   PS C:> $a.pstypenames
   System.Object[]
   System.Array
   System.Object

   PS C:> $a[0].pstypenames
   System.Int32
   System.ValueType
   System.Object

  - Larry
0
Larry__Weiss
6/16/2010 2:56:21 PM
windows.powershell 690 articles. 0 followers. Follow

1 Replies
1560 Views

Similar Articles

[PageSpeed] 10

And this one: if all you care about objects in the pipe are their type, 
Get-Member is too much.
I sometimes use the Get-Type below:

function Get-Type
{
  $input |
  %{$_.gettype()} | select Name -unique
}


PS> dir | Get-Type

Name
----
DirectoryInfo
FileInfo



~Hans



"Larry__Weiss" <lfw@airmail.net> schreef in bericht 
news:uMPyXQWDLHA.2052@TK2MSFTNGP06.phx.gbl...
> http://app.en25.com/e/es.aspx?s=1403&e=4513&elq=5704846539654ee18e58b4d31d7fb3ff
>
> concerns the "hidden" property named pstypenames .
> (Hidden in the sense that GetMember requires -Force to disclose it.)
>
> For example:
>
>   PS C:> $a = 'Hello'
>   PS C:> $a.pstypenames
>   System.String
>   System.Object
>
>   PS C:> $a = 1
>   PS C:> $a.pstypenames
>   System.Int32
>   System.ValueType
>   System.Object
>
>   PS C:> $a = 1,2,3
>   PS C:> $a.pstypenames
>   System.Object[]
>   System.Array
>   System.Object
>
>   PS C:> $a[0].pstypenames
>   System.Int32
>   System.ValueType
>   System.Object
>
>  - Larry 

0
Hans
6/25/2010 9:58:58 PM
Reply:

Similar Artilces:

pstypenames
http://app.en25.com/e/es.aspx?s=1403&e=4513&elq=5704846539654ee18e58b4d31d7fb3ff concerns the "hidden" property named pstypenames . (Hidden in the sense that GetMember requires -Force to disclose it.) For example: PS C:> $a = 'Hello' PS C:> $a.pstypenames System.String System.Object PS C:> $a = 1 PS C:> $a.pstypenames System.Int32 System.ValueType System.Object PS C:> $a = 1,2,3 PS C:> $a.pstypenames System.Object[] System.Array System.Object PS C:> $a[0].pstypenames Sy...