Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Use PowerShell to Clean Up Temp Files

$
0
0

Summary: Use Windows PowerShell to delete temporary files.

Hey, Scripting Guy! Question How can I use Windows PowerShell to clean up a bunch of files that are stored in my temp directory?

Hey, Scripting Guy! Answer Use the Get-ChildItem cmdlet (dir is an alias), point it to the $env:temp directory, and pipe the results
           to the Remove-Item cmdlet, for example:

dir $env:TEMP -Recurse | Remove-Item -Force -Recurse


Viewing all articles
Browse latest Browse all 3333

Trending Articles