Chapters/measuring-tool-performance/test.ps1

Write-Host "Round 1"
Measure-Command -Expression {
    Get-Service | 
    ForEach-Object { $_.Name }
}

Write-Host "Round 2"
Measure-Command -Expression {
    Get-Service | 
    Select-Object Name
}

Write-Host "Round 3"
Measure-Command -Expression {
    ForEach ($service in (Get-Service)) {
        $service.name
    }
}