Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Ertavf/187de58aa23336a475651eccd5cee309 to your computer and use it in GitHub Desktop.
Save Ertavf/187de58aa23336a475651eccd5cee309 to your computer and use it in GitHub Desktop.
powershell remove files with specific pattern
$regex = "\s\(\d+\)\."
$a = Get-ChildItem -Path . -Recurse | Where-Object { $_.Name -match $regex }
$a | Remove-Item -Confirm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment