← Learn
Safe
Get-ChildItem C:\Users -Include *.ps1 -Recurse -ErrorAction SilentlyContinue | Select-String -Pattern 'Invoke-Expression' | Select-Object Path,LineNumber

windows · powershell · Nightmare

Searches user PowerShell scripts for uses of Invoke-Expression and reports where they appear. The most alarming token in the whole dataset appears here as a search pattern rather than as something being executed — read what the command does with the string, not merely that the string is present.

Think you can spot these under time pressure?

Start Training

More PowerShell