Views:

Applies to Product- Power Automate

What’s happening?

The customer is unable to export all Power Automate flows to a local directory using PowerShell commands, and is seeking an alternate solution.


Reason:
This arises from the unsupported version of the PowerShell commands being used, which results in only folders being created without the corresponding zip files of the flows.


Resolution:

  1. Install PowerShell Modules:
  2. Open PowerShell as Administrator.
  3. Run the following commands to install the required modules: Install-Module -Name Microsoft.PowerApps.Administration.PowerShell -AllowClobber -Force Install-Module -Name Microsoft.PowerApps.PowerShell -AllowClobber -Force
  4. Authenticate to Power Automate:
  5. Run the command to authenticate: Add-PowerAppsAccount
  6. A login window will appear; enter your credentials to authenticate.
  7. Get the List of Flows:
  8. Run the following command to retrieve the list of flows: $flows = Get-AdminFlow
  9. Export the Flows:
  10. Create a directory to save the exported flows: $exportPath = "C:\PowerAutomateFlows" New-Item -ItemType Directory -Path $exportPath
  11. Loop through each flow and export it: foreach ($flow in $flows) { $flowName = $flow.DisplayName $flowId = $flow.FlowName Export-AdminFlow -EnvironmentName $flow.EnvironmentName -FlowName $flowId -FilePath "$exportPath\$flowName.zip" }
  12. Check for Unsupported Versions:
  13. If the above steps do not work, verify if the version of PowerShell being used is supported for exporting flows. 
  14. Refer to Documentation:
  15. For additional guidance, refer to the official documentation on exporting flows and ensure that third-party cookies are enabled in your browser settings: https://learn.microsoft.com/en-us/power-automate/export-import-flow-non-solution