@echo off setlocal set "inputString=hello_world" for /f "delims=" %%i in ('powershell -File "ConvertToUpperCase.ps1" -inputString "%inputString%"') do set "outputVar=%%i" echo %outputVar% endlocal