I've been experiencing this weird issue where equality operators will not work intuitively inside a function.
When I call the script copied below in my terminal, the function returns "False", but I am expecting it to return "True". The equivalent inline if(-eq)/else expression works fine, but does not work when embedded inside of a function. Is anyone able to enlighten me as to why this is happening?
Note: I am using PS 5.1.22621.1778
function MatchCheck($input_text_1, $input_text_2)
{
if ($input_text_1 -eq $input_text_2)
{
return($true)
}
else
{
return($false)
}
}
MatchCheck("test", "test")