How To Delete Microsoft Flows Using PowerShell

In this blog, you will see how to delete flows that have been created or shared with you which contain “test” keyword in the display name. I have created 2 flows named “Testing” and “Testing 001” which will be deleted using PowerShell.

Refer to my previous blog - How to connect to Microsoft Flow using PowerShell.

Open PowerShell window and run the following script. Enter the credentials in the login pop up window.

  1. Add PowerApps Account  
  2. Add-PowerAppsAccount
  3.   
  4. # Get all the flow which contains "Test" in the display name  
  5. $flowColl=Get-Flow *test*  
  6.   
  7. # Loop through the flow collection  
  8. foreach($flow in $flowColl)  
  9. {  
  10.     # Get the flow ID  
  11.     $flowName=$flow.FlowName  
  12.   
  13.     # Remove the flow  
  14.     Remove-Flow -FlowName $flowName -Confirm:$false   
  15. }  

Output

Flows deleted successfully.

 

Thus in this blog, you saw how to delete flows using PowerShell.