From e4dc87b646986688d4a982cef134f7429c2f32cc Mon Sep 17 00:00:00 2001 From: Chris Franco <11533365+Francommit@users.noreply.github.com> Date: Thu, 16 May 2024 19:22:18 +1000 Subject: [PATCH] Try a switch statement --- prepare.ps1 | 50 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/prepare.ps1 b/prepare.ps1 index eee7019..2413d68 100644 --- a/prepare.ps1 +++ b/prepare.ps1 @@ -1213,22 +1213,40 @@ function Setup-DesktopShortcuts { } - -# Main script -Get-ScriptPath -ScriptPath $MyInvocation.MyCommand.Path -Install-Chocolatey -InstallScoop -ConfigureScoop -Install-AdditionalSoftware -AcquireFiles -Install-EmulationStation -Setup-EmulatorCores -Start-RetroarchAndGenerateConfig -Setup-Roms -Setup-EmulationStationConfig -Setup-DolphinConfig -Setup-Scraper -Setup-DesktopShortcuts +switch ($args[0]) { + "-installDependencies" { + Install-Chocolatey + InstallScoop + ConfigureScoop + Install-AdditionalSoftware + } + "-acquireFiles" { + AcquireFiles + } + "-setupRoms" { + Setup-Roms + Setup-EmulationStationConfig + Setup-DolphinConfig + Setup-Scraper + Setup-DesktopShortcuts + } + default { + # If no parameter is provided, execute all functions + Install-Chocolatey + InstallScoop + ConfigureScoop + Install-AdditionalSoftware + AcquireFiles + Install-EmulationStation + Setup-EmulatorCores + Start-RetroarchAndGenerateConfig + Setup-Roms + Setup-EmulationStationConfig + Setup-DolphinConfig + Setup-Scraper + Setup-DesktopShortcuts + } +} # TO-DO: Review if this is still needed or not # # https://www.ngemu.com/threads/epsxe-2-0-5-startup-crash-black-screen-fix-here.199169/