Quick PowerShell Script!!

If you have a temp directory that has many items in, selecting all from Explorer and then deleting them takes longer than using a simple PowerShell command:

Here is the command you can run:

  • Get-ChildItem -Path “C:\Windows\Temp” *.* -Recurse | Remove-Item -Force -Recurse
Powershell:- list missing windows updates in windows 10(20h2)

If there are files in use, you will get an error as below which is normal but the bulk of the items should be removed:

Powershell:- list missing windows updates in windows 10(20h2)

That is how simple it is to clear out the temp directory.

Hope it helps.

    wpChatIcon

    Discover more from Everything-PowerShell

    Subscribe now to keep reading and get access to the full archive.

    Continue reading