PowerShell Script to Find Connectors from PowerApps Apps

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


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

image.png

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

One thought on “PowerShell Script to Find Connectors from PowerApps Apps

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

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s