I want to scan a directory (there are no subs) and delete any file with an extension of .avi
I tried this syntax, but no errors are thrown, and no files are deleted. This is the code I tried
get-childitem 'C:\Users\ramrod\Desktop\Firefly' -include *.avi | foreach ($_) {remove-item $_.fullname}
What should be altered in order to delete all the .avi
files from the folder?
rm *.avi
? (Yes, that's valid PowerShell syntax becauserm
is an alias ofdel
.rm
anddel
are both aliases of theRemove-Item
cmdlet.