Easiest Way to Restore Deleted Apps in Power Apps

Recently, a client brought our Power Apps employee leave management application and requested customizations to align with their business standards.

While making those changes, I noticed a few duplicate environment variables and decided to clean them up. Unfortunately, one of those variables was still linked to the app, and deleting it also deleted the entire Power Apps application.

At that point, the app was no longer in the environment, and restoring it from the UI wasn’t an option. After some searching, I discovered that PowerShell provides a way to restore deleted Power Apps.

In this tutorial, I’ll show you exactly how to restore a deleted Power Apps application using PowerShell, so if this ever happens to you, you’ll know how to recover it step by step.

Recovering Deleted Power Apps Using PowerShell

To recover deleted apps, your account must be a “Power Platform Admin” or “Global Admin“. Then run the following commands step by step in Windows PowerShell ISE or Visual Studio Code, where you have installed the PowerShell module.

  1. Run the command below to install the NuGet Package provider.
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force -Scope CurrentUser

Here:

  • -MinimumVersion = Ensures compatibility
  • -Force = Skips confirmation prompts
  • -Scope CurrentUser = No admin rights required

NuGet is the package provider PowerShell uses to download and install modules from online repositories, such as the PowerShell Gallery.

  1. To install the Power Apps administration module, run the command below.
Install-Module -Name Microsoft.PowerApps.Administration.PowerShell -Scope CurrentUser -Force

Here:

  • -Scope CurrentUser = It installs modules at the user level and avoids requiring elevated (admin) PowerShell.

This module provides admin-level Power Apps commands, such as:

  • Viewing environments
  • Listing deleted Power Apps
  • Recovering deleted apps

Without this module, admin commands like recovering deleted apps won’t work.

  1. Run the following command to install the Power Apps user module.
Install-Module -Name Microsoft.PowerApps.PowerShell -Scope CurrentUser -AllowClobber -Force

Here:

  • -AllowClobber = Allows newer commands to overwrite older ones if necessary.

This module contains the Power Apps commands, such as:

  • Connecting to Power Apps
  • Managing apps you own
  • Working with flows and environments
  1. Run the below command to set the PowerShell execution policy.
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned -Force

PowerShell restricts script execution by default for security reasons. So RemoteSigned will allow:

  • Scripts will be created locally and can run without restriction.

This setting will:

  • Allows Power Apps modules to load and run properly.
  • Applies only to the current user, not the entire system.
  1. To connect with Power Apps, run the following command.
Add-PowerAppsAccount

This command opens a Microsoft login prompt and asks you to authenticate your Power Apps account.

  1. Run the below command to get the list of deleted Power Apps applications in the specified environment.
Get-AdminDeletedPowerAppsList -EnvironmentName Default-898a21d4-ed73-44f4-8cac-c7bde6d52e57

Here:

  • -EnvironmentName = Provide the environment Id. You have two simple ways to receive this ID.
    • On the Power Apps Studio URL, as shown in the image below.
    • Click on the settings [Gear icon] ->Open the Developer resources -> Environment ID.
power apps recycle bin

This command will list all deleted Power Apps in the specified environment. Returns important details such as:

  • AppName (GUID)
  • DisplayName
  • CreationTime, etc. As you can see in the image below.
recover deleted power apps app
  1. Run the command below to recover a deleted Power App application.
Get-AdminRecoverDeletedPowerApp `
  -EnvironmentName Default-898a21d4-ed73-44f4-8cac-c7bde6d52e57 `
  -AppName dcc92e89-50da-4775-9dc2-c8f4f65564bb

This command restores the app to its original configuration and makes it visible again in Power Apps Studio.

  • -EnvironmentName = Provide the Power Apps environment ID.
  • -AppName = Provide the Deleted App ID.

Once the command runs successfully, you will see a message like 200, with code and description OK, as shown in the image below.

Recovering Deleted Power Apps Using PowerShell
  1. Now open the Power Apps Studio and search for the deleted app. You will be able to see it as shown in the image below.
How to Restore Deleted Apps in PowerApps

This way, you can easily recover the deleted app using PowerShell.

Conclusion

I hope you found this article helpful. In this post, I explained how to restore a deleted Power Apps application using PowerShell, what permissions are required, and how to find the environment ID, etc., with a step-by-step guide.

Feel free to comment if you need any support or are facing any issues while following this approach to restore the deleted app.

Also, have a look at some of our related Power Apps tutorials:

Power Apps functions free pdf

30 Power Apps Functions

This free guide walks you through the 30 most-used Power Apps functions with real business examples, exact syntax, and results you can see.

Download User registration canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App