Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Unanswered

get-adminflow does not return the new flows in an environment after deployment of solution

(0) ShareShare
ReportReport
Posted on by 222

Hello community, 


I'm using a PowerShell script to enable flows in the off status after the deployment of a solution via an Azure DevOps pipeline.

I'm using get-adminflow to detect the flows in an environment. It seems that I cannot detect flow in the off status (Enabled = false) 
What I did as test using a PowerShell terminal with version 5.1.22621.608

 

Install-Module -Name Microsoft.PowerApps.Administration.PowerShell -Scope CurrentUser
Install-Module -Name Microsoft.PowerApps.PowerShell -AllowClobber -Scope CurrentUser
Add-PowerAppsAccount -Endpoint prod
get-adminflow -environmentname [guid]

The result is null because the flows have not been enabled. When manually turning on/off, I can discover the flows via the commando above. What do I forget here? 
Thanks for the support.

Frederik 
  • frederikbisback Profile Picture
    222 on at
    Re: get-adminflow does not return the new flows in an environment after deployment of solution

    @cchannon@westerdaled,
    I have used the script to test using an account that has global admin permissions on the tenant. 
    PowerShell Version 7.2.7 give me a failure. 
    Add-PowerAppsAccount: Exception calling "AcquireToken" with "4" argument(s): "Could not load type 'System.Security.Cryptography.SHA256Cng' from assembly 'System.Core,Version=4.0.0.0, Culture=neutral, PublicKeyToken='."
    PowerShell 5.1 has the same issue. I can detect the environment name [guide]. But I cannot detect the flow. 
    I can detect the flow when I do the same in the development environment and UAT after a manual deployment. 
    I need to do more investigation within the pipeline, which could be related to this problem. I will keep you posted. 

     
  • frederikbisback Profile Picture
    222 on at
    Re: get-adminflow does not return the new flows in an environment after deployment of solution

    @cchannon, Copy And Paste Error.

    @westerdaled, I will check yours. 

    I will keep you both posted. 

  • cchannon Profile Picture
    4,702 Super User 2025 Season 1 on at
    Re: get-adminflow does not return the new flows in an environment after deployment of solution

    @frederikbisback in your sample code above, your last line - the relevant one - was all lower-case instead of Pascal case. That is, you had 

    get-adminflow -environmentname [guid]

    instead of 

    Get-AdminFlow -EnvironmentName [guid]

    Was that just a copy/paste error, or is that maybe related to your problem?

  • westerdaled Profile Picture
    616 on at
    Re: get-adminflow does not return the new flows in an environment after deployment of solution

    Hi

     

    I am testing out a similar scenario for one of my clients and I have added the relevant snippet below.  In my case I using PS ver 7.2.7 which shouldn't be supported but appears to work😁

     

     

     

     

    $PWord = ConvertTo-SecureString -String'Your pw' -AsPlainText -Force 
    Add-PowerAppsAccount -Username "Your acc" -Password $PWord
    
    $userId = "<Object Id of the user account who deployed the solution>"
    $env = "YourEvironment" //
    write-host $env
    # get the environment Id 
    $envName = (Get-PowerAppEnvironment -Filter *$env*).EnvironmentName
    // get flows for the user who deployed the solution
    $deployedFlows = Get-AdminFlow -EnvironmentName $envName -CreatedBy $userId
    // ok so which ones do we need to turn on
    $deployedFlows | Where {!$_.Enabled}

     

     

     

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 109 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 82 Super User 2025 Season 1

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 72

Overall leaderboard