In PowerShell, how can I test if a variable holds a numeric value?
Currently, I\'m trying to do it like this, but it always seems to return false.
false
You can check whether the variable is a number like this: $val -is [int]
$val -is [int]
This will work for numeric values, but not if the number is wrapped in quotes:
1 -is [int] True "1" -is [int] False