function interprets negative integers as a string instead of integers

function Get-Factorial ($x) { if($x -isnot [int]){ return "please enter an integer" } if ($x -eq 0) { return 1 } return $x * (Get-Factorial($x - 1)) }

get-factorial -2 returns an error, but get-factorial (-2) works.

the only way to avoid the issue is to put the negative integer in a parenthesis, but I’m trying to avoid that.