function time { Param( [Parameter(Mandatory=$true)] [string]$command, [switch]$quiet = $false ) $start = Get-Date try { if ( -not $quiet ) { iex $command | Write-Host } else { iex $command > $null } } finally { $(Get-Date) - $start } }