rwheeler23
asked on
Powrshell success notifications
I now have about a dozen Powershell scripts using WinSCP that export data and transfer those exports to an SFTP server. Is there some way to get notification via text or email informing of either success or failure.
ASKER
So within the Powershell script I can direct output to a log file? It can just be a text file and then I could email the text file. Can you please supply a sample code snippet?
to write to a file, you could simply refer to Add-Content method
Powershell - Append content to File
https://www.tutorialspoint.com/powershell/powershell_filesio_append.htmASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you probably can write the logs (success, failed, etc) into a db logs, and then use some automated tasks (such as scheduled tasks, control-M jobs, etc) to consolidate and send out the log reports.
if you want to do it once the FTP job is finished, then probably you could send out the email / sms within your powershell scripts.