Kaffeeundcode
Script Library
PowerShell 01.06.2026

Script Workspace

Measure ScriptExecution

Review the purpose, inspect the code, then test it safely in your own tenant.

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."