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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Action Run Powershell ...
Power Automate
Unanswered

Action Run Powershell Script Fail

(0) ShareShare
ReportReport
Posted on by 9

 

 

 

 

Hello,

Need someone advise on this. Run out of solutions. I have a simple Run PowerShell Script with the same code as the Microsoft documentation: https://docs.microsoft.com/en-us/power-automate/desktop-flows/actions-reference/scripting

 

It fails every time I run the flow. The thing is the flow was already running Run PowerShell Script actions, because it was a flow that I reuse and change only a few subflows.

 

Tried rebooting, unistalled and installed it again. Same error:

 

´´´´Microsoft.Flow.RPA.Desktop.Robin.SDK.ActionException: Failed to run PowerShell script. ---> System.ComponentModel.Win32Exception: The system cannot find the file specified
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at Microsoft.Flow.RPA.Desktop.Modules.System.Actions.SystemActions.RunPowershellScript(Variant powershellCode, Variant& scriptStandardOutput, Variant& scriptErrorOutput)
--- End of inner exception stack trace ---
at Microsoft.Flow.RPA.Desktop.Modules.System.Actions.RunPowershellScript.Execute(ActionContext context)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary`2 inputArguments, Dictionary`2 outputArguments)

´´´´

 

The only thing I can think of is somehow the power automate desktop loses is internal reference (possibly memory leak?). My thanks in advance for any advise.

I have the same question (0)
  • Highboy Profile Picture
    1,187 Super User 2024 Season 1 on at

    Looks like it can't find a certain file.
    Could you please post the powershell script, doing that will help us help you 😊

  • lkjio Profile Picture
    9 on at

    Thanks for the reply @Highboy.

    The Run Power shell scritp action only has the following code:

     

    $variableName = "variableValue"
    Write-Output $variableName

     

    On my computer

    OS Name Microsoft Windows 10 Pro
    Version 10.0.19042 Build 19042

    The weirdest thing is I don't have any issues when I connect to my remote machine and with my credentials I am able to run everything with:

    OS Name Microsoft Windows Server 2016 Datacenter

    Version 10.0.14393 Build 14393

     

    As you said @Highboy, I reused the code of another flow, and at a certain point it gave me a error reading a file. Deleted the code in the action and pasted the above code.

  • Highboy Profile Picture
    1,187 Super User 2024 Season 1 on at

    So, if you create a new flow and paste the code into a powershell action, will it fail?

  • lkjio Profile Picture
    9 on at

    Yes, it will fail. Same error, different flow

  • Henrik_M Profile Picture
    2,021 Super User 2024 Season 1 on at

    Can you copy the PAD actions themselves and paste the resulting text somewhere. Then compare. Maybe there's some corruption going on that can't be seen "with the naked eye"...?

  • Highboy Profile Picture
    1,187 Super User 2024 Season 1 on at

    Is it possible that you could copy and paste your script here?

     

  • lkjio Profile Picture
    9 on at

    Thanks for the reply @Highboy.

    The Run Power shell scritp action only has the following code:

     

    $variableName = "variableValue"
    Write-Output $variableName

     

    On my computer

    OS Name Microsoft Windows 10 Pro
    Version 10.0.19042 Build 19042

    The weirdest thing is I don't have any issues when I connect to my remote machine and with my credentials I am able to run everything with:

    OS Name Microsoft Windows Server 2016 Datacenter

    Version 10.0.14393 Build 14393

     

    As you said @Highboy, I reused the code of another flow, and at a certain point it gave me a error reading a file. Deleted the code in the action and pasted the above code.

  • lkjio Profile Picture
    9 on at

    The Run Power shell scritp action only has the following code:

     

    $variableName = "variableValue"
    Write-Output $variableName

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hey, I'm actually facing the same issue. Do you finally find a solution ?

    Sincerely

  • PetrosM Profile Picture
    30 on at

    Currently facing exactly the same issue. All powershell actions no longer work and throw the same error, even rudimental ones like creating a folder...
    Any suggestions?

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 233

#2
David_MA Profile Picture

David_MA 217 Super User 2026 Season 1

#3
Valantis Profile Picture

Valantis 190

Last 30 days Overall leaderboard