cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
brmdaniels
Level: Power Up

Trigger a PowerShell Script in Flow when Receiving an Email

Hello, 

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! 

 

1 REPLY 1
Dual Super User
Dual Super User

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.

https://www.cyberdrain.com/mini-blog-how-to-use-azure-functions-to-run-powershell-scripts/



-------------------------------------------------------------------------
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

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 338 members 6,141 guests
Please welcome our newest community members: