Skip to content

Repair and clean up Windows,
locally or remotely

PowerShell modules and scripts for everyday IT work: repair system files and Windows Update, clear temp data and content caches, remove user profiles and Autodesk products. With CMTrace logs and exit codes you can script against.

Repair-System

Module

DISM and SFC, component store cleanup, a Windows Update reset that keeps the update history, WMI and ConfigMgr client repair. One remoting session, one log, a per-step exit code.

TempDataCleanup

Module

User and system temp, logs, browser and Teams caches, and the ConfigMgr, Intune, Adaptiva and Windows Update content caches. A whole device list in parallel.

removeUserProfile.ps1

Script

Removes Windows user profiles after backing up their registry keys, mapped drives and printers. Renames the folder to .old, or deletes it with -Delete.

AutoDeskCleanRemove.ps1

Script

Autodesk's clean uninstall (2022 and newer), unattended: every bundle and MSI product, folders, user data and registry keys, backed up first. Ready for Intune and ConfigMgr.

CredentialHandler

Module

Get-CredentialObject asks for credentials in the console, where Get-Credential fails in Windows PowerShell 5.1 with Windows Terminal as the default terminal.

Shortcuts

Module

Get-Shortcut reads target, arguments, icon and hotkey of .lnk files, one file or a whole folder. Set-Shortcut creates or changes them.

Built for IT work

  • Local or remote. Repair-System and TempDataCleanup run on the local computer or over PowerShell remoting (WinRM), for one computer, a list or the pipeline, and copy their logs back to your PC.
  • Nothing half done. What Windows keeps locked is finished at the next restart, and the run tells you so.
  • Logs you can read. Repair-System, TempDataCleanup, removeUserProfile and AutoDeskCleanRemove write CMTrace-compatible logs, so they open in CMTrace or OneTrace with warnings and errors highlighted.
  • Exit codes for deployment tools. Repair-System and the scripts return documented exit codes for ConfigMgr, Intune, scheduled tasks and your own scripts; Repair-System adds a detailed per-step code.
  • Careful by design. TempDataCleanup refuses drive roots and system folders, the scripts back up registry keys before deleting them, and the invasive options ask before they run.

Get the tools

The four modules come as one suite with an installer: one for all users (needs admin rights), one for your account only. Both are on the latest release. The scripts are single .ps1 files in the repository. The user manual has the steps.

Download the installer View on GitHub

Review before you run

These tools repair, clean up and remove things on Windows systems. Read what a command does, test it on a test machine first, and only run it on devices you're authorized to change. They are provided as-is and are not supported by Microsoft.

Documentation

Support

Questions: write to contact@kmarflow.com. A problem: open an issue on GitHub or write an e-mail; Reporting a problem lists what to include. An idea: suggest it on GitHub. News and articles are on the blog at kmarflow.com, and the PowerShell cmdlets collection there has more commands for daily admin work.