How can I return multiple values from a powershell script to the batch file that is calling it?
I have a powershell script that returns multiple values. I want to call it from a batch file and have each individual value go into an individual variable in the batch file.
Only been able to return one value
The powershell code (pstest.ps1):
$p1=11
$p2=22
$p3=33
exit
The batch file:
powershell .\pstest.ps1
:: now I'd like to get those 3 returned values
:: into 3 individual variables so that I can do something like this:
@echo First is %p1%, Second is %p2%, Third is %p3%
So, it should display this:
First is 11, Second is 22, Third is 33