Created
May 5, 2023 14:02
-
-
Save Ertavf/187de58aa23336a475651eccd5cee309 to your computer and use it in GitHub Desktop.
powershell remove files with specific pattern
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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