Menu

Virtual Geek

Tales from real IT system administrators world and non-production environment

Blog posts July 2026

Navigating Nested Loops in PowerShell A Guide to Loop Labels

At first glance, as in the below shared PowerShell script looks like a simple set of nested foreach loops printing numbers. But it has very powerful - and always overlooked - control structure: called Loop Label.

:OuterLoop foreach ($OuterNumber in 1..4)
{    
    Write-Host "== Starting Oute…

Read more

How to Capture PowerShell Trace and Debug Messages in DebugView

When you’re running PowerShell scripts as scheduled tasks, background jobs, Runspace jobs, or on remote servers, normal Write-Host or Write-Debug output often disappears. That’s where System.Diagnostics.Trace comes in.

System.Diagnostics.Trace is a built-in.NET class designed to instrument, monit…

Read more

How to Get Installed Software Features List Using PowerShell WMI-CIM

While working with VMware Tools, I needed to audit exactly which features/components were installed on a VM. VMware Tools isn’t just one package — it installs several sub-features like drivers, services, and utilities. I wanted a clean report showing each component and whether it was actually instal…

Read more

PowerShell Pro Tip: How to Overwrite and Update the Same Line ProgressBar

When writing long-running PowerShell scripts, displaying real-time feedback keeps users engaged and reassures them that the script hasn't frozen. However, flooding the console with hundreds of lines of text makes it unreadable, and using Clear-Host causes an annoying screen flicker.

The ideal sol…

Read more

4 blog posts

Blog Search

Page Views

1 5 1 4 6 0 3 2

Archive

Follow me on Blogarama