How to use PowerShell to disable the consent dialog when a user opens Microsoft Power Apps for the first time or adds a new connection.
Set Consent Bypass
PowerShell can disable the consent dialog when the user opens the Power App for the first time or adds a new connection.
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force
dir . | Unblock-File
Install-Module -Name Microsoft.PowerApps.Administration.PowerShell
Install-Module -Name Microsoft.PowerApps.PowerShell -AllowClobber
Import-Module Microsoft.Online.SharePoint.Powershell -Verbose
Connect-SPOService -Url {Your SharePoint Admin Tenant URL}
Set-AdminPowerAppApisToBypassConsent -AppName {Your App ID}
When prompted, enter your Environment ID in the URL or the Power Platform Admin center in the chosen Environment.
Clear Consent Bypass
The PowerShell clears the consent bypass. When users open the app for the first time or if a connection is added or updated, they will be prompted for consent.
Clear-AdminPowerAppApisToBypassConsent -AppName {Your App Id}