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.
PowerShell craft · Note 1 ↗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.
PowerShell craft · Note 1 ↗Find out which resource groups are eating your Azure budget, straight from PowerShell, no portal clicking required.
PowerShell craft · Note 7 ↗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.
The Microsoft Graph toolbox · Note 5 ↗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.
Local admin, done right · Note 4 ↗One object per update deployment with targeted, compliant, failed and unknown counts, so you can spot the deployments that need you.
Windows Update, untangled · Note 8 ↗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.
Windows Update, untangled · Note 7 ↗Install a product key, activate it and confirm the edition actually changed, without the key ever landing in a script file or a log.
Packaging with ConfigMgr · Note 5 ↗Turn "wrap this script in a package and push it to the DPs" into one command, with a dry run before anything gets created.
Packaging with ConfigMgr · Note 1 ↗When Graph cmdlets start throwing assembly errors, it's almost always mixed module versions. This removes every copy and puts back one matching set.
The Microsoft Graph toolbox · Note 1 ↗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.
The Microsoft Graph toolbox · Note 4 ↗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.
Keeping Active Directory tidy · Note 4 ↗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 ↗