Jump to content

Automating Oxide Downloads to TCA.Mods Folder


fjamieson

Recommended Posts

I am trying to automate downloading the latest Oxide-Rust.zip file to my RUST/TCA.Mods folder. Because the posted link continuously changes now, and the thread notifications are unreliable, I end up with unhappy users.

 

I have a Powershell script that is called from a Windows batch file, using the Windows Task scheduler, but would rather this be under the control of TCAdmin.

 

My question is can I paste the following script into a TCA scheduled task

~~~~

getoxide.bat

powershell -ExecutionPolicy ByPass -File oxide.ps1

~~~~

oxide.ps1

$json = Invoke-RestMethod -Uri

"https://api.github.com/repos/OxideMod/Oxide.Rust/releases/latest"

$url = $json.tag_name

$url =

"https://github.com/OxideMod/Oxide.Rust/releases/download/$url/Oxide.Rust.zip"

echo $url

(New-Object System.Net.WebClient).DownloadFile($url, "Oxide-Rust.zip")

~~~~

 

Or is there a better way to achieve this update process?

 

Thanks in advance for any suggestions and comments.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Who's Online   0 Members, 0 Anonymous, 38 Guests (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use