All Content
Timespan
Restoring Deleted Flows with PowerShell Commands Guide
Image Source: Shutterstock.com
Power Automate
Oct 19, 2022 5:27 PM

Restoring Deleted Flows with PowerShell Commands Guide

by HubSite 365 about Microsoft

Software Development Redmond, Washington

External Blog Post
Citizen Developer

Power Automate

Discover step-by-step guide on restoring deleted flows in Microsoft Power Automate using PowerShell commands.

This blog post from Microsoft provides a comprehensive guide on restoring deleted flows using PowerShell commands and Microsoft's automation service. It's crucial to note that these restoration steps can be applied to both non-solution and solution flows. However, any flow that has been deleted for more than 21 days cannot be recovered. Following a successful restoration, the flow defaults to a disabled state and must be manually enabled by the user.

Two primary restoration methods are detailed in this guide. The first involves using the Automation Tool Management Connector. It explains how one can restore a deleted non-solution or solution flow within 21 days of deletion using this tool. This procedure is relatively straightforward, as it consists of administrative level actions such as "List Flows as Admin" and "Restore Deleted Flows as Admin".

Moreover, restorations can be performed in four simple steps: Listing deleted flows using "List Flows as Admin" action, using the "Restore Deleted Flows as Admin" action to retrieve the flow required, reactivating the flow, and finally, observing that the recovered flow has been successfully restored in a disabled state.

The second method featured in the guide instructs users on restoring deleted flows using PowerShell. Requirements for this technique include installation of the newest version of PowerShell cmdlets for Power Apps, administrator access, and an execution policy that permits the running of PowerShell scripts. It provides a step-by-step guide, starting from launching PowerShell, all the way to entering script commands to reinstate soft-deleted flows.

The guide also offers the possibility to utilize scripts that can find all flows, including soft-deleted ones, in a particular environment, or filter the list of flows using a segment of the deleted flow’s name. It goes on to provide instructions on restoring the flow using the "Restore-AdminFlow" script, and even details how to restore multiple deleted flows using script commands.

Further Analysis

We can conclude that Microsoft has built a robust system for restoring accidentally deleted flows within a 21-day window using either the automation tool's Management Connector or PowerShell commands. This guide makes it clear that despite accidental deletions, users and administrators have the tools they need to recover necessary data quickly and efficiently.

Given the depth of the guide from Microsoft, more attention should be drawn to implementing proper safety measures and protocols to prevent unintentional deletion of flows. This would save users from having to invest time and effort into restoration processes.

In cases where data loss does occur, the detailed steps provided in the guide seem to be a dependable manual for flow recovery, even for users with limited technical knowledge. In both methods, a strong emphasis is placed on administrator roles, establishing that vigilance at the upper levels of management can be an effective bulwark against potential data loss.

Read the full article Guide: Restoring Deleted Flows Using PowerShell Commands

Power Automate - Restoring Deleted Flows with PowerShell Commands Guide

Learn about Guide: Restoring Deleted Flows Using PowerShell Commands

Microsoft users can often mistakenly delete their flows. However, there is no cause for worry as the process of retrieving deleted flows is quite simple. There are two methods you can use to restore deleted workflows within 21 days of deletion. The two methods are via the Automation Management tool or via PowerShell. These steps are applicable to both solution and non-solution flows. Note, however, that any flows deleted more than 21 days prior cannot be recovered. Once a workflow is restored, it defaults to the disabled state, you will need to manually enable it based on your needs.

The Automation Management tool allows you to recover a deleted solution or non-solution workflow within 21 days of deletion. As an admin, the process is relatively straightforward; only a series of actions are required to restore a deleted workflow. Essentially, you will create a series of actions to first list the deleted workflows in the environment and then apply the Restore Deleted Workflows action to recover the necessary workflow.

Users can restore their workflow with a button trigger, utilising the 'List Workflows as Admin' feature. By selecting the right options, admins can easily see all the workflows in the environment that they have access to, even the ones that were soft-deleted. From here, admins can identify the workflow they're looking to recover and restore the workflow using the 'Restore Deleted Workflows as Admin' action.

  • Choose the 'Restore Deleted Workflows as Admin' option from the Automation Management Tool.
  • Enter the flow's name previously saved in step 3 in the input field and run the program.
  • After successfully executing the run, you will notice that the workflow has been restored to its disabled state.


An alternative way of restoring a deleted flow is by using PowerShell. It does require some prerequisites, like having the latest version of PowerShell cmdlets for Power Apps and being an environment admin.

The steps to restoring deleted flows with PowerShell are pretty straightforward. You start by opening PowerShell with elevated privileges. Then, install the newest version of PowerShell cmdlets for Power Apps.

  • Start by signing in to your Power Apps environment, using the command 'Add-PowerAppsAccount'.
  • Provide the necessary credentials for your environment.
  • Next, run the following script to list all the workflows in the environment, including those that were soft-deleted within the past 21 days.
  • Retrieve the respective flowName value from the previous step and proceed with a set of scripts to perform the restoration. After recovery, reset the restored flow to an 'enabled' state by executing the 'Start-Sleep' command for about one second.

Your feedback regarding these procedures is always invaluable to us. Sharing your experiences allows us to refine and improve our services in the future.

More links on about Guide: Restoring Deleted Flows Using PowerShell Commands

Restore deleted flows in Power Automate
Apr 24, 2023 — Restore deleted flows with the Power Automate Management connector · Run the flow. · Expand the flow run. · Expand the raw OUTPUTS/value of the ...
Restore deleted flows - Power Platform Release Plan
Oct 18, 2022 — Install and authenticate the cmdlets. · Get the flowName of the deleted flow with the Get-AdminFlow command. PowerShell. Copy. Get-AdminFlow - ...

Keywords

Restoring Deleted Flows, PowerShell Commands, Guide, PowerShell Flows Restoration, Deleted Flows Recovery, PowerShell Guide, Restoring Flows, PowerShell Commands Guide, Recovery Using PowerShell, Deleted PowerShell Flows