Skip to content

Instantly share code, notes, and snippets.

@jesselawson
jesselawson / remove-files-containing-string-in-filename.ps1
Created April 19, 2016 14:35
Powershell - Remove all files where filename contains string
$string = "MyString"
get-childitem | where-object {$_.Name -like "*$string*"} | foreach ($_) {remove-item $_.fullname}