spjeff / sppatchify

SharePoint Patchify - centralized tool to apply CU patch to entire farm from one console
MIT License
1 stars 0 forks source link

Email option #11

Closed rolandon closed 7 years ago

rolandon commented 7 years ago

Hello, is there a way to have the script send a email if something fails during the process? I would like to get an email sent if there is an issue and after the patching is completed.

spjeff commented 7 years ago

Good idea.

I found sample PowerShell code at https://blogs.msdn.microsoft.com/vijaysk/2008/04/08/automatically-email-powershell-session-transcript/ and merged into the main PS1 with version 0.71

Would you please download the latest and test?

.\SPPatchify.ps1 -emailReportTo "somebody@company.com" -emailReportFrom "sharepoint@company.com -emailReportServer "mailrelay.company.com"

rolandon commented 7 years ago

I get the below error

.\SPPatchify.ps1 -emailReportTo "test@company.com" .\SPPatchify.ps1 : A positional parameter cannot be found that accepts argument 'test@company.com'. At line:1 char:1

spjeff commented 7 years ago

Updated params from [switch] to [string].

Please test again.

https://github.com/spjeff/sppatchify/releases/download/v0.71/SPPatchify.zip