System.RuntimeType
inherits from System.Reflection.TypeInfo
which inherits from System.Type
which inherits from System.Reflection.MemberInfo
Type is an abstract base class that allows multiple implementations. The system will always provide the derived class RuntimeType. In reflection, all classes beginning with the word Runtime are created only once per object in the system and support comparison operations.
PS C:\> $curDir = get-item . PS C:\> $curDir | get-member TypeName: System.RuntimeType … PS C:\> $curDir.GetType().GetType().FullName System.RuntimeType
System.RuntimeType
is also returned when using the square brackes on a type name: PS C:\> [System.Data.SqlTypes.SqlDecimal].GetType().FullName System.RuntimeType
-as
operator of PowerShell, it is possible to cast a string to a type: 'system.int32' -as [type]