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
@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.
@cchannon, Copy And Paste Error.
@westerdaled, I will check yours.
I will keep you both posted.
@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?
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}
WarrenBelz
109
Most Valuable Professional
Michael E. Gernaey
82
Super User 2025 Season 1
MS.Ragavendar
72