web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / get-adminflow does not...
Power Apps
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 
I have the same question (0)
  • westerdaled Profile Picture
    672 on at

    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}

     

     

     

     

     

  • cchannon Profile Picture
    4,702 Moderator on at

    @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?

  • frederikbisback Profile Picture
    222 on at

    @cchannon, Copy And Paste Error.

    @westerdaled, I will check yours. 

    I will keep you both posted. 

  • frederikbisback Profile Picture
    222 on at

    @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. 

     

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 474

#1
Valantis Profile Picture

Valantis 474

#3
WarrenBelz Profile Picture

WarrenBelz 375 Most Valuable Professional

Last 30 days Overall leaderboard