Advertisement
Guest User

RetroArch update cores

a guest
Oct 12th, 2021
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $ZipNames = @(
  2.     "gong_libretro.dll.zip",
  3.     "squirreljme_libretro.dll.zip",
  4.     "potator_libretro.dll.zip",
  5.     "freeintv_libretro.dll.zip"
  6. )
  7. $CoreDest = "${PSScriptRoot}\cores\"
  8. $CoresBaseUri = "https://buildbot.libretro.com/nightly/windows/x86_64/latest/"
  9. $LogDest = "${PSScriptRoot}\core_update.log"
  10.  
  11. try {
  12.     Start-Transcript -Path $LogDest -UseMinimalHeader
  13. }
  14. catch [System.Management.Automation.ParameterBindingException] {
  15.     Start-Transcript -Path $LogDest
  16. }
  17.  
  18.  
  19. foreach ($zip in $ZipNames)
  20. {
  21.     $params = @{
  22.         "Uri" = ($CoresBaseUri + $zip)
  23.         "OutFile" = ($CoreDest + $zip)
  24.         "Verbose" = $true
  25.     }
  26.     try {
  27.         Invoke-WebRequest @params
  28.     }
  29.     catch {
  30.         continue
  31.     }
  32.  
  33.     $params = @{
  34.         "LiteralPath" = ($CoreDest + $zip)
  35.         "DestinationPath" = $CoreDest
  36.         "Force" = $true
  37.         "Verbose" = $true
  38.     }
  39.     Expand-Archive @params
  40.     Remove-Item ($CoreDest + $zip) -Verbose
  41. }
  42.  
  43. Stop-Transcript
  44.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement