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

PoshBytes: PowerShell Splatting – The Art of Throwing Parameters With Style

PoshBytes: PowerShell Splatting – The Art of Throwing Parameters With Style In this PoshBytes episode, you will learn PowerShell splatting to make long commands readable and reusable. We will also demo PSNotes cmdlets that generate splats for you and convert existing commands into splatted form. This post is a companion for the video embedded below. Scroll down to see the code...