PowerShell: Check Type
💡 TIP: Operator names are case-insensitive.
value -is type
-
test if a value is a given type.
🛑 WARNING: the value to be tested must be on the left-hand-side.
3 -is [int] # True 3.4 -is [double] # True "abc" -is [string] # True 3,4 -is [Array] # True
(3).GetType().FullName # System.Int32 "abc".GetType().FullName # System.String
value -isnot type
-
negation of
-is