The -WhatIf Trap Hiding in ForEach-Object
A dry run that quietly lies to you. Why ForEach-Object's property shorthand returns nothing under -WhatIf, and the one-line fix.
EXPLORE THE NOTEBOOK
Notes from the command line, the workbench, and the vintage computer shelf.
A dry run that quietly lies to you. Why ForEach-Object's property shorthand returns nothing under -WhatIf, and the one-line fix.
Find out which resource groups are eating your Azure budget, straight from PowerShell, no portal clicking required.
One script that locks a departing user out, cleans up their groups and licenses, and keeps their mail, with a CSV record of every step.
Put a domain group into the local Administrators group on a list of computers (or take one out) over PowerShell remoting, with a result for every machine and -WhatIf first.
One object per update deployment with targeted, compliant, failed and unknown counts, so you can spot the deployments that need you.
Find the updates the most machines are actually missing, bundle them into a group, and deploy them to a pilot collection, with a WhatIf preview first.
Install a product key, activate it and confirm the edition actually changed, without the key ever landing in a script file or a log.
Turn "wrap this script in a package and push it to the DPs" into one command, with a dry run before anything gets created.
When Graph cmdlets start throwing assembly errors, it's almost always mixed module versions. This removes every copy and puts back one matching set.
Before you rename, rescope or delete a group, find out what it's wired to. Members, owners, licenses, apps and Intune policies, in one report.
A computer inventory straight out of AD, with OS build, last logon, password age and OU in one tidy CSV, ready for audits or a stale-machine cleanup.
Turn a folder of CBR comics into CBZ with 7-Zip, and optionally shrink the pages to WebP with cwebp or ImageMagick, testing every file before anything is replaced.
Archive conversion workshop · Note 4 ↗