Dimeji Olayinka
Dimeji Olayinka

Reputation: 81

How can I trigger Power Automate Desktop Flow run with a Powershell Script

Hello I am trying to trigger a Power Automate Desktop Flow on an Azure Virtual Machine. Initially I tried to trigger through a scheduled Power Automate Cloud flow but I am unable to set up any connection to the VM directly nor the on premise data gateway residing on it because I CANNOT log on to the VM with a password. So in response is there a way for me to trigger a Power Automate Desktop flow run via Powershell script, Command line, or any other process that is NOT through a Power Automate cloud flow?

Upvotes: 0

Views: 5009

Answers (1)

ozmike
ozmike

Reputation: 2788

A partial solution below.

You can trigger power automate flow from the non desktop product - power automate this is a premium product feature. If you can't do this a partial work around is to create a desktop flow that polls (checks every so often) a directory or similar to trigger some action. The below image shows how to schedule a desktop flow to do something after a certain period of time. This could be modified to pick up a trigger from a file or some other event. However, this solution requires that you manually start the job in the VM. Once started it will keep running. If you need to kick off the flow on restart of the VM the below soluion won't help. In this case you will have to automate the desktop product (ironic) using third party product like AutoIt or autoHotKeys to start the flow on boot of the VM.

Hopefully Ms will provide a way to kick off jobs via the command line in the future.

Help that helps. enter image description here

Upvotes: 0

Related Questions