I have a process where I set a variable in batch but then want to reset back to another value from a PowerShell process that I'm executing but can't seem to get it to work.
Here is my logic:
Code: Select all
SET "PRE_NOTIFY=T" & CALL :EMAIL
Code: Select all
:EMAIL
::-- Set Distribution List --::
IF NOT DEFINED ERR SET "EMAIL_TO=%EMAIL_DL_ADMIN%"
IF DEFINED ERR SET "EMAIL_TO=%EMAIL_DL_ADMIN%"
POWERSHELL -ExecutionPolicy ByPass -file "%EMAIL_BIN%Email_Utility.ps1" ^
"%EMAIL_SERVER%" ^
"%EMAIL_FROM%" ^
"%EMAIL_TO%" ^
"%EMAIL_PSSWD%" ^
"%EMAIL_PORT%"
CLS
GOTO :EOF
Code: Select all
$Env:PRE_NOTIFY "updated"