RunPowershell.cmd 587 B

1234567891011
  1. @ECHO OFF
  2. SET _TAIL=%*
  3. CALL SET _TAIL=%%_TAIL:*%1=%%
  4. SET POWERSHELL=%windir%\System32\WindowsPowerShell\v1.0\powershell.exe
  5. rem Force 64bit powershell
  6. if /i "%PROCESSOR_ARCHITEW6432%" EQU "AMD64" SET POWERSHELL=%windir%\sysnative\WindowsPowerShell\v1.0\powershell.exe
  7. echo "PS: Running '%~dp0%1' %_TAIL%"
  8. %POWERSHELL% -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; try { & '%~dp0%1' %_TAIL%; exit $LASTEXITCODE } catch { write-host $_; exit 1 }"