Created
April 19, 2016 14:35
-
-
Save jesselawson/6407233782659a709c4d0029c808d0aa to your computer and use it in GitHub Desktop.
Powershell - Remove all files where filename contains string
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
$string = "MyString" | |
get-childitem | where-object {$_.Name -like "*$string*"} | foreach ($_) {remove-item $_.fullname} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks works a treat.