PoshBytes

PoshBytes: Stop Guessing and Start Measuring with Stopwatch

PoshBytes: Stop Guessing and Start Measuring with Stopwatch Learn how to time PowerShell code with System.Diagnostics.Stopwatch and read TimeSpan output correctly, including a visible progress pause you can actually watch. This post is a companion for the video embedded below. Scroll down to see the code from the video. The Basic Stopwatch Output elapsed time $sw = [System.Diagnostics.Stopwatch]::StartNew() Start-Sleep -Seconds 2...
PoshBytes

PoshBytes: CmdletBinding The Secret Sauce for Advanced Functions

PoshBytes: CmdletBinding The Secret Sauce for Advanced Functions In this PoshBytes episode, we turn a humble PowerShell function into an advanced function using CmdletBinding. You will see common parameters come alive, WhatIf and Confirm safety nets, and a pipeline-friendly pattern you can reuse everywhere. This post is a companion for the video embedded below. Scroll down to see the code from...