From f61ff082f69046186af46a8de2c34a8c6ff150a6 Mon Sep 17 00:00:00 2001 From: jake Date: Tue, 18 Nov 2025 16:43:43 -0500 Subject: [PATCH] adding powershell port --- README.md | 5 ++++- mods.ps1 | 30 ++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 mods.ps1 diff --git a/README.md b/README.md index 42b5a93..f27e315 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # grab-mods downloads the mods from [server-mods](https://code.jakeyoungdev.com/minecraft/server-mods) and moves them into the correct spot for Minecraft. This program will delete all other existing mods before moving them -# requirements +## Powershell rewrite +I have started a rewrite in powershell to work more natively on windows machines + +## requirements you need git bash to run this, download it [here](https://github.com/git-for-windows/git/releases/download/v2.51.0.windows.2/Git-2.51.0.2-64-bit.exe) and run thru the setup there is no sign-up or anything required so don't give it info \ No newline at end of file diff --git a/mods.ps1 b/mods.ps1 new file mode 100644 index 0000000..44e7380 --- /dev/null +++ b/mods.ps1 @@ -0,0 +1,30 @@ +#this is the powershell conversion of the mod grab script to play more natively with windows +Write-Output "----------------------------------------- +Welcome to the mod helper! This program will overwrite +the mods on your pc with the newest seasons mods. This +program will delete all old mods, so move them if you want +to keep them. +-----------------------------------------" + +Read-Host -Prompt "Press any key to continue" | Out-Null + +New-Item -ItemType Directory mods +New-Item -ItemType Directory mods/files +#download file data +Invoke-WebRequest -Uri "https://code.jakeyoungdev.com/minecraft/server-mods/raw/branch/main/unzip_me.zip" -OutFile ./mods/unzip_me.zip +Expand-Archive -DestinationPath ./mods/files/ -Path ./mods/unzip_me.zip + +#delete current mods +$UsrNameStr = $Env:UserName +Remove-Item "C:/Users/$UsrNameStr/AppData/Roaming/.minecraft/mods/*.jar" + +#move new mods +Move-Item -Path "./mods/files/*.jar" -Destination "C:/Users/$UsrNameStr/AppData/Roaming/.minecraft/mods/" + +#clean up our mess +Remove-Item -Recurse ./mods + +Write-Output " +----------------------------------------- +The new mods should be installed on your pc +-----------------------------------------" \ No newline at end of file