In PowerShell, why can't I call the Sum()
method on an int[]
? For example:
[int[]]$arr = 1, 2, 3
$arr.Sum() # InvalidOperation: Method invocation failed because [System.Int32] does not contain a method named 'Sum'.
Yet, this method exists in .NET 3.5 and newer. So what's going on here?