Weird Issue, unless i'm overlooking it?
Posted: 04 Apr 2020 07:55
Hi Folks -
I have a simple routine that sends an email via PowerShell. However, I ONLY want to redirect if and error occurs. However, when I use this syntax, it's still creating a blank file:
Is there a way ONLY to produce a file on a true error?
I have a simple routine that sends an email via PowerShell. However, I ONLY want to redirect if and error occurs. However, when I use this syntax, it's still creating a blank file:
Code: Select all
POWERSHELL -ExecutionPolicy ByPass -file "Email_Utility.ps1" ^
"%EMAIL_SERVERzz%" ^
"%EMAIL_FROM%" ^
"%EMAIL_FDMEE_DL%" ^
"%EMAIL_PSSWD%" ^
"%EMAIL_PORT%" 2>"emailerr.log"
pause