I decided to golf up this kumite - for the sanity of the tester, I trim the function definition to remove leading or trailing spaces.

Code
Diff
  • Write-Verbose (Get-Module pester -listAvailable).Version.ToString()
    function calculate_multiples {
        (1..999|?{!($_%3) -or !($_%5)}|measure -s).sum
    }
  • 1+
    Write-Verbose (Get-Module pester -listAvailable).Version.ToString()
    
    11
    function calculate_multiples {
    
    2
    3
        $SUM = 0
    
    4
    5
        1..999 | ForEach-Object {
    
    6
            if (!( $_ % 3) -OR !($_ % 5)) {
    
    7
                $Sum += $_
    
    8
            }
    
    9
        }
    
    10
    11
      return $Sum
    
    3+
        (1..999|?{!($_%3) -or !($_%5)}|measure -s).sum
    
    1212
    }