Get-EnvironmentFlowInventory
This PowerShell script produces a full inventory of every cloud flow in a single Power Platform environment — display name, flow GUID, state, owner, trigger type, and timestamps — exported to CSV. It's a lighter-weight starting point than Get-FlowConnectionOwnershipAudit or Get-FlowsByPersonConnection: no connection joins, no flagging, just a straightforward baseline of what flows exist in an environment and who owns them, which is a useful first pass before running either of those deeper audits.
Purpose
- Installs and imports
Microsoft.PowerApps.Administration.PowerShellif it isn't already present, then signs in interactively viaAdd-PowerAppsAccount - Retrieves every flow in the specified environment via
Get-AdminFlow - Builds one row per flow with display name, flow GUID, state, owner UPN and object ID, created/last-modified timestamps, and trigger type(s)
- Exports the inventory to a dated CSV in the configured output folder, and prints a sorted summary table to the console
Scope
- Scoped to a single environment per run — set
$EnvironmentNameat the top and re-run per environment for a tenant-wide inventory - Settings are edited directly at the top of the script rather than passed as parameters, so there's no
-EnvironmentNameflag to script around TriggerTypeis read from each flow'sdefinitionSummary; flows where that summary doesn't resolve (child flows, some trigger types) report an empty value rather than erroring- This is an inventory, not an audit — it doesn't join flows to the connections they use or flag anything; for that, see Get-FlowConnectionOwnershipAudit or Get-FlowsByPersonConnection
- Requires Power Platform admin rights to see flows owned by other people, not just your own
Prerequisites
Microsoft.PowerApps.Administration.PowerShellmodule (auto-installed if missing)- Power Platform admin rights, to see other people's flows across the environment
- The target environment's ID (GUID), found via
Get-AdminPowerAppEnvironmentor the Power Platform admin center URL
PowerShell Script
<#
.SYNOPSIS
Exports an inventory of all cloud flows in one Power Platform environment to CSV.
Set the two variables below, then run the script.
#>
# ======================= SETTINGS: EDIT THESE =============================
# >>> PASTE THE ENVIRONMENT ID (GUID) BETWEEN THE QUOTES <<<
$EnvironmentName = ""
# Where the CSV will be saved
$OutputPath = "C:\Temp"
# ==========================================================================
if ([string]::IsNullOrWhiteSpace($EnvironmentName)) {
Write-Host "Please set `$EnvironmentName at the top of the script first." -ForegroundColor Yellow
return
}
# --- Module -------------------------------------------------------------
if (-not (Get-Module -ListAvailable -Name Microsoft.PowerApps.Administration.PowerShell)) {
Install-Module -Name Microsoft.PowerApps.Administration.PowerShell -Scope CurrentUser -Force
}
Import-Module Microsoft.PowerApps.Administration.PowerShell
# --- Sign in (needs Power Platform admin rights to see other people's flows) ---
Add-PowerAppsAccount
# --- Get the flows ------------------------------------------------------
$flows = Get-AdminFlow -EnvironmentName $EnvironmentName
Write-Host "Found $(@($flows).Count) flow(s)." -ForegroundColor Cyan
$inventory = foreach ($flow in $flows) {
$props = $flow.Internal.properties
[pscustomobject]@{
DisplayName = $flow.DisplayName
FlowName = $flow.FlowName # the flow's GUID
State = $props.state # Started / Stopped / Suspended
OwnerUPN = $flow.CreatedBy.userPrincipalName
OwnerObjectId = $flow.CreatedBy.userId
CreatedTime = $flow.CreatedTime
LastModified = $flow.LastModifiedTime
TriggerType = ($props.definitionSummary.triggers | ForEach-Object { $_.type }) -join "; "
Environment = $EnvironmentName
}
}
# --- Output -------------------------------------------------------------
if (-not (Test-Path $OutputPath)) { New-Item -ItemType Directory -Path $OutputPath | Out-Null }
$csvPath = Join-Path $OutputPath ("FlowInventory_{0:yyyy-MM-dd}.csv" -f (Get-Date))
$inventory | Sort-Object DisplayName | Export-Csv -Path $csvPath -NoTypeInformation -Encoding UTF8
$inventory | Sort-Object DisplayName | Format-Table DisplayName, State, OwnerUPN, LastModified -AutoSize
Write-Host "Saved to $csvPath" -ForegroundColor Green
Usage Notes
$EnvironmentNamemust be set to the environment's GUID before running — the script stops with a warning if it's left blank$OutputPathdefaults toC:\Tempand is created automatically if it doesn't already exist- The CSV is named
FlowInventory_<yyyy-MM-dd>.csvand written fresh each day; running the script twice in one day overwrites the previous file OwnerUPNandOwnerObjectIdcome from each flow'sCreatedByproperty — the original creator, not necessarily the current owner if ownership has since been reassignedTriggerTypejoins multiple trigger types with"; "where a flow has more than one- The console table (sorted by
DisplayName) is a quick look at the key fields; the CSV holds every field in the inventory
Related
- Get-FlowConnectionOwnershipAudit — the natural next step after this inventory: joins every flow to the connections it depends on and flags any owner that isn't your nominated service account
- Get-FlowsByPersonConnection — a targeted offboarding check once this inventory confirms which flows a departing person owns