I want to take advantage of powershell to make some simple math calculations inside a batch script. I'm able to calculate a floating point division in a batch script with
set numerator=3.5
for /f %%i in ('powershell 10/%numerator%') do (set result=%%i)
which correctly sets the result variable to 2.85714285714286, but I was not able to call from the batch script a powershell command like powershell [math]::max(3,4), which returns the maximum of two numbers. Calling
for /f %%i in ('powershell [math]::max^(3,4^)') do (set result=%%i)
from a batch script sets the result variable to +.
Thanks in advance for any help.