web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Trigger a PowerShell Script in Flow when Receiving an Email

(0) ShareShare
ReportReport
Posted on by

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! 

 

I have the same question (0)
  • Pstork1 Profile Picture
    68,676 Most Valuable Professional on at
    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/

  • stevenbaron86 Profile Picture
    41 on at
    Re: Trigger a PowerShell Script in Flow when Receiving an Email

    Old thread but keeps coming up in searches. The above is no longer the only way. You can use the onprem data gateway to get data onsite. from there evaluate options. fifo db, drop files and a watcher, something like that.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Coming soon: forum hierarchy changes

In our never-ending quest to improve we are simplifying the forum hierarchy…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 544 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 482 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 287

Last 30 days Overall leaderboard