Trying to understand why the following code block returns different results.
$item1 = "bill"
$item2 = "bill"
# This returns "Values are the same"
if ($item1 -eq $item2) {
    echo "Values are the same"
}
else {
    echo "Values are NOT the same"
}
# This returns "Values are NOT same"
function compare_items($i1, $i2)
{
    if ($i1 -eq $i2) {
        echo "Values are the same"
    }
    else {
        echo "Values are NOT the same"
    }
}
compare_items($item1, $item2)
I would think both return the same result as values being the same. I've tried type casting the variables as [string] and still getting same mismatch of results.
 
    