-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrvm.bat
More file actions
15 lines (15 loc) · 675 Bytes
/
Copy pathrvm.bat
File metadata and controls
15 lines (15 loc) · 675 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
@echo off
:: RVM launcher - uses own directory to find rvm.ps1 (no env var dependency)
set "RVM_DIR=%~dp0"
set "PS_FILE=%RVM_DIR%rvm.ps1"
pwsh.exe -NoProfile -ExecutionPolicy Bypass -Command "& '%PS_FILE:\=\\%' %*" 2>nul
if %errorlevel%==0 goto :refreshpath
powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "& '%PS_FILE:\=\\%' %*" 2>nul
if %errorlevel%==0 goto :refreshpath
echo ERROR: PowerShell not found. Check that PowerShell is installed.
exit /b 1
:refreshpath
:: Refresh PATH from registry so subsequent commands see latest user PATH
for /f "tokens=2* delims=" %%A in ('reg query "HKCU\Environment" /v PATH 2^>nul ^| findstr REG_') do (
set "PATH=%%B"
)