Page 1 of 1

Weird Issue, unless i'm overlooking it?

Posted: 04 Apr 2020 07:55
by SIMMS7400
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:

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	
Is there a way ONLY to produce a file on a true error?

Re: Weird Issue, unless i'm overlooking it?

Posted: 04 Apr 2020 09:45
by ShadowThief
Is there a line in Email_Utility.ps1 to create a file?