Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove all .ica files

I've tried a few different ways and still the same results it don't work.

remove-item .\*\appdata\local\temp\* -Include *.ica

I want it to remove all the .ica files in the users temp folder.

like image 664
user770022 Avatar asked Mar 15 '23 06:03

user770022


2 Answers

Looks like you're looking for the users' temp folder. If you're looking for that you can find it with $path = $env:temp Use that for the $path that @kekimian used.

The finished product would look something like this:

$path = $env:temp
Get-ChildItem -path $path -Filter "*.ica" -Force -Recurse | Remove-Item -Force -Confirm:$False
like image 140
Nixphoe Avatar answered Mar 25 '23 05:03

Nixphoe


Try this:

$path = path to the folder
Get-ChildItem -path -Filter "*.ica" |  where { ! $_.PSIsContainer } | Remove-Item -Force -Confirm:$true
like image 45
kekimian Avatar answered Mar 25 '23 03:03

kekimian