Skip to content

Commit

Permalink
updated Test-IsNumericType to include process block
Browse files Browse the repository at this point in the history
  • Loading branch information
hollanjs committed Dec 16, 2022
1 parent 918b8a3 commit c52c8c1
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions source/Public/Test-IsNumericType.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,27 @@ function Test-IsNumericType
$Object
)

$isNumeric = $false

if (
$Object -is [System.Byte] -or
$Object -is [System.Int16] -or
$Object -is [System.Int32] -or
$Object -is [System.Int64] -or
$Object -is [System.SByte] -or
$Object -is [System.UInt16] -or
$Object -is [System.UInt32] -or
$Object -is [System.UInt64] -or
$Object -is [System.Decimal] -or
$Object -is [System.Double] -or
$Object -is [System.Single]
)
Process
{
$isNumeric = $true
$isNumeric = $false

if (
$Object -is [System.Byte] -or
$Object -is [System.Int16] -or
$Object -is [System.Int32] -or
$Object -is [System.Int64] -or
$Object -is [System.SByte] -or
$Object -is [System.UInt16] -or
$Object -is [System.UInt32] -or
$Object -is [System.UInt64] -or
$Object -is [System.Decimal] -or
$Object -is [System.Double] -or
$Object -is [System.Single]
)
{
$isNumeric = $true
}

return $isNumeric
}

return $isNumeric
}

0 comments on commit c52c8c1

Please sign in to comment.