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
If you want to check if a string has a numeric value, use this code:
$a = "44.4" $b = "ad" $rtn = "" [double]::TryParse($a,[ref]$rtn) [double]::TryParse($b,[ref]$rtn)
Credits go here