troubleshooting Question

Can you use PowerShell to selectively delete certain Internet Explorer Temporary Internet files in the cache

Avatar of John Delise
John Delise asked on
PowershellGolang
7 Comments1 Solution656 ViewsLast Modified:
We want to write a script that based on a txt pattern found in the file properties, will delete a file with that pattern in it's name or Internet Address property.

The iNetCache files display when you go into the general tab of IE options and select view files. the columns have properties of the files, Name, Internet Address, Type etc. But they are not really in that folder, this is a user friendly display, you can right click on any of the files and look at the properties page to see the true location.

We were able get the get-childitem powerShell command to to get the file objects for all files under c:\users\<Username>\Microsoft
(Carefull line is wrapping) Using the commands below, but the properties returned do not include the "Internet Addresss" property.
#Get the Folder name for the users InetCache
$_userInetCacheFolder = "$($ENV:UserProfile)\AppData\Local\Microsoft\Windows\INetCache"

$_UserInetLeafObjects = Get-ChildItem -Path $_userInetCacheFolder  -force -recurse

How do we retrieve the "internet address" property as part of the file object information returned.

If we had it we would use a foreach loop to do a match comparison to the a text string, say "dmus", if the "dmus" string was in the internet address property value we would delete that file and any other file of Type "HTML Document" or "COOKIE file"

Unless I can match on  a pattern on one or more of those properties, it does not seem doable.
ASKER CERTIFIED SOLUTION
Chris Dent
PowerShell Developer
Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros