Ad
Fundamentals
Arrays

I was struggling with this Kata "Sum Of Positive".
On my computer:

Sum-OfPositive($test = @(1, 2, 3, 4, 5))
15

The function should work as intended, but I can't pass the tests.
What's wrong?

I am using Powershell 6.0.
On 7.2 will not pass for reasons which are unknown to me. Can someone also explain me why?

function Get-SumOfPositive($NumberArray)
{
$Sum =0;
foreach($Number in $NumbArray){
    if($Number -gt 0){
            $Sum+=$Number
        }
    }
Write-Output $Sum
}