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

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Powershell runs forever
Power Automate
Suggested Answer

Powershell runs forever

(1) ShareShare
ReportReport
Posted on by 22

Hi,

 

I have a desktop flow in which I need to launch a browser under a different Windows user than the one currently logged in on the server. To achieve this, I use the Run PowerShell script action in Power Automate Desktop.

 

The PowerShell “Run As” script itself is very simple, and it works correctly — the browser opens under the intended user as expected. However, the flow does not proceed past the Run PowerShell script action. It remains stuck on that step, even though the browser has already opened successfully. The only way to make the flow continue is to close the browser window manually; once the browser is closed, the flow immediately moves on to the next action.

 

Based on this behavior, I suspect the issue lies within Power Automate Desktop rather than the script itself, as the exact same script executes perfectly when run directly inside the PowerShell console.

I have the same question (0)
  • Suggested answer
    eetuRobo Profile Picture
    4,401 Super User 2026 Season 1 on at
    I haven't done anything like this before but these are suggestions that came to mind:

    Make the action timeout at some point and continue the flow. If I understood correctly the browser opens correctly but the only issue is that the flow never continues from the "Run PowerShell script" -action.

    1. Add timeout to the "Run PowerShell script" -action. Add some amount that you know it should not go over.


    2. Add On error handling to continue the flow run


    Then maybe add "If window" -condition to check if the browser window has actually opened. and if not try again with longer time out and if it still haven't opened the browser Stop flow and some additional error handling



    Can you share the PowerShell script so that we could maybe spot the issue why it never finishes. 
    Maybe try adding "exit" line after it opens the browser process. 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 124 Super User 2026 Season 1

#2
Ellis Karim Profile Picture

Ellis Karim 52 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 47 Most Valuable Professional

Last 30 days Overall leaderboard