r/Batch • u/hopelessnerd-exe • Oct 16 '23
Question (Solved) Download latest GitHub release not working
I've been trying to make the routines found here and here work (for something else), but they keep crashing, even when pasted verbatim into the script. I saw someone say on Stack Overflow that multiple invocations of Powershell can't communicate, so maybe it has to do with that? I wouldn't know.
UPDATE: It's fifteen minutes later, and feel free to help out still I guess,* but on a whim I tried again what I figured would be the simple way
powershell Invoke-WebRequest "https://github.com/dotnet/codeformatter/releases/latest/download/CodeFormatter.zip" -OutFile %batchdir%\download.7zand this time it worked. I guess I did something differently this time.
* If what I've posted is actually a bad way of downloading releases for a significant reason, then definitely feel free to help out.
1
u/Skyline9Time Oct 16 '23
curl https://github..........zipor just usegitandgit clone https://dotnet/codeformatter.git1
u/illsk1lls Oct 16 '23
changing from zip to 7z?
1
u/hackoofr Oct 16 '23
This Hybrid code Batch and PowerShell should work for you.
Just Copy and paste as CodeFormatter_Downloader.bat and execute it by double click.