Skip to content

Instantly share code, notes, and snippets.

@SilvortheGrand
Last active September 10, 2025 17:28
Show Gist options
  • Select an option

  • Save SilvortheGrand/cdeebfceff5298acc8b22cc9f915e892 to your computer and use it in GitHub Desktop.

Select an option

Save SilvortheGrand/cdeebfceff5298acc8b22cc9f915e892 to your computer and use it in GitHub Desktop.
Drop the script into the folder with the zip files and run it using pwsh ./cleaninstallhd2mods.ps1
h2mm list
[int] $amountOfModsToNuke = 0
while (-not [int]::TryParse((Read-Host "Please enter the amount of mods you wanna nuke."), [ref] $amountOfModsToNuke) -or $amountOfModsToNuke -lt 1){}
for (; $amountOfModsToNuke -gt 0; $amountOfModsToNuke--) {
Write-Host "Nuking mod #$amountOfModsToNuke..."
h2mm uninstall -i $amountOfModsToNuke
if ($?) {
Write-Host "Successfully nuked $amountOfModsToNuke" -ForegroundColor Green
}
else {
Write-Host "Could not nuke $amountOfModsToNuke." -ForegroundColor Red
}
}
Write-Host "Installing mods in folder..." -ForegroundColor Blue
Get-ChildItem *.zip | ForEach-Object { h2mm install $_ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment