Showing results for 
Search instead for 
Did you mean: 
New Member

Trigger a PowerShell Script in Flow when Receiving an Email


I'm looking to create a Flow that will run a PS script (On prem or in Azure) when an email is received. The email would come from a certain user and would contain a phrase in the subject. If this is not possible what about using a Button to trigger a PS script? In that case I would like to share that button with a user. Thanks in Advace! 


Dual Super User II
Dual Super User II

Re: Trigger a PowerShell Script in Flow when Receiving an Email

First, there is no way to expose a button in Flow since it runs in the background. There is also no way to invoke PowerShell in an on-premises environment from Flow.  Flow runs on the server in the cloud and you need to invoke the script on a computer in the on-premises environment. I have read that you can create an Azure Function that can invoke PowerShell.  You could then invoke that function from Flow.  Here's an article on how to create an Azure function to invoke PowerShell.

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources


Super User Program Update

Three Super User rank tiers have been launched!


Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021


New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!


Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (8,192)