If you are like me, the best way to learn is hands on. There are hundreds of Power Platform community content such as blogs, videos, presentations and learning paths.
Chances are, your boss or clients won’t be keen on you experimenting using their production environments. A great way to experiment is to use the Power Apps Community Plan. The community plan is a FREE, non-production environment where you can build and try out many aspects of the Power Platform.
However, over time it is going to get filled with junk. There will be a bunch of entities that you created when you wanted to try building a model-driven app. There was that canvas app you built for the hackathon. Remember that old portal you created to figure out how entity permissions worked?
There will come a day when you want to wipe that environment clean and start from scratch.
No problem, right? You know you can delete environments using the Power Platform Admin center. Select the environment and choose Delete.
However, once you select your community plan environment (aka Developer environment) you notice that you do NOT have the option to delete or reset the environment!
The ability to delete developer environments is blocked from the Power Platform Admin center.
PowerShell to the Rescue!
As per the Microsoft Docs, Tenant level admins have the ability to delete an individual environment from the user interface, however this still doesn’t appear to be the case. However, it does provide how to delete the environment using PowerShell.
PowerShell is a task-automation, command-line scripting language. PowerShell is used by administrators to automate a variety of tasks.
The first step is to enable the Power Platform commandlets on your machine. (Assuming you are running a Windows machine, right?)
Search for Powershell and run as an Administrator.
You will be presented with a command-line interface. If you are 30 years old or below, don’t be afraid, this is how your parents learned how to interact with a computer. They didn’t click, they typed in commands (just like in the movies).
Install Power Platform Modules
The next step is to install the Power Platform modules. Again, Microsoft Docs has some great resources (click here).
Enter in the following (cut and paste or type)
Install-Module -Name Microsoft.PowerApps.Administration.PowerShell
You may get a few messages about “untrusted repositories” In all cases, choose “Y” or “A” to continue the process.
Then enter in the following (cut and paste, or type)
Install-Module -Name Microsoft.PowerApps.PowerShell -AllowClobber
Again, you may get a few messages about untrusted repositories.
Locate your Developer Environment GUID
Now that the Power Platform modules are installed, you have access to a large list of different automation tasks for various Power Platform chores (e.g. create environments, update permissions, etc) If you are interested to learn more, check out the Microsoft Docs.
For now, lets locate the GUID of the developer environment you wish to delete.
Enter in the following command;
You will then get prompted for your Power Platform credentials, enter in your login and password.
You will then see the listing of all your environments. Locate your developer environment and copy the GUID. You will need this in the next step.
Delete that Developer Environment!
NOTE: You cannot backup your environment. Once it is gone, it is gone. There will not even be a “Are you sure?” message (that you would likely ignore anyway). If you do want to save something, export the assets.
The final step is to delete the developer environment. Enter in the following command;
Remove-AdminPowerAppEnvironment -EnvironmentName <<guid>>
And that’s it! Your developer environment is now gone. Deleted, kaput, gonzo. You can now go back to the Power Apps Community Plan site and create a brand new fresh environment.
Everyone deserves a fresh start, including Power Platform learners. I hope these steps give you that clean new environment to continue learning and experimenting cool new Power Platform features. I also hope you learned something about PowerShell, and possibly exposed you to a new world of automating a variety of tedious Power Platform tasks.
Nick Doelman is a Microsoft Business Applications MVP, a Microsoft Certified Trainer and isn’t afraid of command-line interfaces. Hear Nick talk about building business applications at DynamicsCon on his talk “You Might Not Need Dynamics CRM. You Need a Power App!“