Windows 10 cleanup with powershell

Raimondi, Anthony (Cognizant) 131 Reputation points
2021-04-22T20:00:35.797+00:00

Hi Guys

Do you have any good PowerShell scripts to cleanup Windows 10 harddrives? I try the cleanmgr but no matter what I do it doesn't clean the "Windows Update Cleanup" option. I need to create a script that I can run on VDIs when they get under 10 GB

Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

Accepted answer
  1. MotoX80 36,291 Reputation points
    2021-04-22T23:18:33.307+00:00

    How about a DISM cleanup?

    Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase
    

2 additional answers

Sort by: Most helpful
  1. Andreas Baumgarten 123.4K Reputation points MVP Volunteer Moderator
    2021-04-22T21:19:10.127+00:00

    Hi @Raimondi, Anthony (Cognizant) ,

    maybe this help:
    https://www.jaapbrasser.com/diskcleanup-remove-previous-windows-versions-powershell-module/

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten


  2. Anonymous
    2021-04-23T02:24:26.88+00:00

    Hi,

    Does this help?

    https://github.com/hematic/Server-OS-Drive-Cleanup-Script/

    Best Regards,
    Ian Xue

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.