In this post I’ll share a script I developed for a customer to find which connectors are used by which PowerApps apps. Currently this is not something available through the Power Platform Admin Center. Feel free to use this script as you see fit. This script is provided as-is without any warranties of any kind. If you update or adapt it and decide to re-post please provide attribution.
Script
Note: If you do not see the below Gist please refer to code at this location: PS-Get_PowerApps_App_Connections.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add-PowerAppsAccount | |
$environments = Get-PowerAppEnvironment | |
foreach($environ in $environments.EnvironmentName) | |
{ | |
$apps = Get-AdminPowerApp –EnvironmentName $environ | |
$apps | Add-Member –MemberType ScriptProperty –Name Connections –Value {$this.internal.properties.connectionReferences.PSObject.Properties.Value.DisplayName} –Force | |
$apps | Select-Object AppName, DisplayName, Connections | |
} |
Sample output
You may notice that the output contains a complex property for the Connections. It has been some time since I worked with formatting output in PowerShell. If you have an improvement to the formatting please share back suggestion and I’ll update the sample script.
-Frog Out
You may enhance it by exporting the information to CSV file.
Thanks.
$allApps = @()
$environments = Get-PowerAppEnvironment
foreach($environ in $environments.EnvironmentName)
{
$apps = Get-AdminPowerApp -EnvironmentName $environ
$apps | Add-Member -MemberType ScriptProperty -Name Connections -Value {$this.internal.properties.connectionReferences.PSObject.Properties.Value.DisplayName} -Force
$apps | Select-Object AppName, DisplayName, Connections
$allApps += $apps
}
$allApps| Export-Csv -Path C:\AllPowerApps_Information.csv -NoTypeInformation
LikeLike