Hello everyone, after searching very hard to find some bat or script file to auto update oxide and all the plugins for Rust  (Windows)
i found this old link (https://oxidemod.org/threads/automate-rust-oxide-and-plugin-updates.11415/) .

i managed to fix the code to auto download Oxide.
but i cant fix the PS code, i already correct some parts but still cant fix it 100%.

this is the code after i correct some "}" positions... sorry i am very noob at PS and code thing... i am more curiosos.

update_plugins.ps1

$helper=new-object -com WScript.Shell
$root='https://umod.org//plugins/'
$fetch = gc 'C:\servidor\rust\oxide\plugins\plugins.txt'
$felch = gc 'C:\servidor\rust\oxide\plugins\filepath.txt' 
Function Download($Tvar)

{
    $ie=new-object -com internetexplorer.application
    $url='https://umod.org/' + (invoke-WebRequest -uri $root$Tvar | select -expand links | select -expand href | sls -simplematch 'version=')
    $ie.navigate($url)
    Start-Sleep -Seconds 1
    $helper.AppActivate('View Downloads - Internet Explorer', $true)
    Start-Sleep -Seconds 2
    $helper.SendKeys('{ENTER}')
    Start-Sleep -Seconds 1
    $helper.SendKeys('{ESC}')
    rv url
    rv Tvar
}

for ($i=0; $i -lt $fetch.Length; $i++) 

{
  Download($fetch[$i])
}

rv fetch
rv felch
rv root
rv helper
rv iMove-Item

Move-Item C:\Users\ffriozi\Downloads\$($felch[$i]) C:\servidor\rust\oxide\plugins\$($felch[$i]) -Force​


This is my output:
https://image.prntscr.com/image/5R1U-mehS1udF4QWMT4Drg.png

any ideas what im doing wrong?
i know the problem is showing above. but i dont understand PS and i dont know how to fix this.

any help will be highly appreciated

Thanks!