Reputation: 1
I have a batch file that is menu driven. Users answer two questions. Based on their answers 2 variables are created and files are transferred. After that, my batch file calls a powershell script to email me. I need to find a way to put the 2 variables from the batch file into the $message = section of the powershell script. Any assistance would be greatly appreciated.
Upvotes: 0
Views: 869
Reputation: 202052
If you are setting environment variables, you can reference those in a PowerShell script spawned from the same cmd.exe environment like so:
$message = "this is your $env:test and you are $env:test2"
Upvotes: 1