Prompt user to dl pwsh if they dont have it

This commit is contained in:
dazedanon 2026-03-07 11:46:31 -06:00
parent 77a2c5d0ee
commit 3e52d81202

View file

@ -34,9 +34,26 @@ set _my_shell=pwsh
REM Check if pwsh.exe exists
where /q !_my_shell!
if !errorlevel! neq 0 (
echo pwsh not found. Falling back to powershell...
REM If pwsh is not found, set to powershell
set _my_shell=powershell
echo pwsh not found.
echo.
echo PowerShell 7 ^(pwsh^) is faster and recommended.
set /p "INSTALL_PWSH=Would you like to install it now via winget? (Y/N): "
if /I "!INSTALL_PWSH!"=="Y" (
echo Installing PowerShell 7 via winget...
winget install --id Microsoft.PowerShell --source winget --accept-package-agreements --accept-source-agreements
if !errorlevel! neq 0 (
echo Install failed or winget not available. Falling back to powershell...
set _my_shell=powershell
) else (
echo PowerShell 7 installed successfully.
echo Please re-run GameUpdate.bat to use pwsh.
pause
exit /b 0
)
) else (
echo Skipping install. Falling back to powershell...
set _my_shell=powershell
)
REM Check if powershell.exe exists
echo Checking for powershell...