Kaffeeundcode

Measure ScriptExecution

Skript Beschreibung

**Zusammenfassung**: Misst die Laufzeit eines Befehls.

Wrapper für Measure-Command.

Skript Infos

Autor Mattia Cirillo
Version 1.0
Sprache PowerShell
99_Measure-ScriptExecution.ps1
<#
.SYNOPSIS
    Misst die Laufzeit eines Befehls.
    
.DESCRIPTION
    Wrapper für Measure-Command.
    
.NOTES
    File Name: 99_Measure-ScriptExecution.ps1
    Author: Mattia Cirillo
    Version: 1.0
#>

param (
    [scriptblock]$Command
)

$Time = Measure-Command { & $Command }
Write-Host "Dauer: $($Time.TotalSeconds) Sekunden."