Many of the admins and builders engaged on automation have constructed tons of of flows in PowerAutomate however they don’t get well timed failure alerts in order that they’ll resubmit the flows.
We had been additionally going through the identical points with our ever-increasing flows and never getting the move failure messages till later within the week.
After researching, we now have devised PowerShell Magic which helps us currently and can now enable you as effectively
Right here is the magic out there for obtain:
Stipulations for this resolution:
Obtain the answer from beneath git hub hyperlink: (flowmonitorandalert.ps1)
https://github.com/VikasSukhija/Downloads
Obtain the answer from PowerShell Gallery:
https://www.powershellgallery.com/packages/flowmonitorandalert
Set up-Script -Identify flowmonitorandalert
Script will auto generate the password first time when it runs and can put it aside as encrypted in the identical folder.
Syntax for working the Script:
To get alert based mostly on Proprietor of the move i.e. who created the move:
.flowmonitorandalert.ps1 -CreatedbyGUID “86981-yjfykv-676-tdyttty” -EnvironmentName “Default-f9u09-7587-6576d-87575” -smtpserver smtp.labtest.com -from flowalert@labtest.com -erroremail Reviews@labtest.com
To get alert based mostly on Identify matching of the move i.e. if identify matches specific string
.flowmonitorandalert.ps1 -FlowNamematch “FLOWMON” -EnvironmentName “Default-f9u09-7587-6576d-87575” smtpserver smtp.labtest.com -from flowalert@labtest.com -erroremail Reviews@labtest.com
Right here is the alert message you’ll obtain:
Schedule this Script Each Hour, it’s going to notify you two instances for one failure, in case you miss one.
$getdate = (Get-Date).AddHours(-2)
To make it quick, Script extracts all of the move data in temp folder on daily basis within the night time at 11 PM, each different time it’s going to simply learn from it.
I hope this magic will help you in case you’re additionally searching for a script that may provide you with a warning when the move fails.
Thanks for studying and downloading….
Tech Wizard