Is there a way to get the name of each Flow which is mine or has been shared with me? I also want to know which connectors its using and which account it uses to use the connectors.
The problem is that this script uses a command Get-Flow which I don't think is valid in Powershell 7. I use Get-AdminFlow instead. Everything is still coming out Unable to resolve as per the Catch statement below. Also, when I run the script there is no command Get-AdminFlow -SharedWithMe ie SharedWithMe is not a parameter for this command.
How can I fix this?
I'm open to using a Flow rather than Powershell.
$ownedFlows = Get-Flow
$sharedFlows = Get-Flow -SharedWithMe
$allFlows = @($ownedFlows) + @($sharedFlows) |
Sort-Object FlowName -Unique
Write-Host "Total Unique Flows Found: $($allFlows.Count)" -ForegroundColor Cyan
# -----------------------------------------------
# STEP 7: Build Report
# -----------------------------------------------
$report = @()
foreach ($flow in $allFlows) {
Write-Host "Processing: $($flow.DisplayName)" -ForegroundColor Yellow
# Get full flow details
$flowDetail = Get-Flow `
-FlowName $flow.FlowName `
-EnvironmentName $flow.EnvironmentName
# --- Ownership Type ---
$isOwned = ($ownedFlows.FlowName -contains $flow.FlowName)
$ownershipType = if ($isOwned) { "Owned" } else { "Shared With Me" }
# --- Flow Owner UPN from Azure AD ---
$ownerUPN = ""
$ownerDisplayName = ""
try {
$createdById = $flowDetail.Internal.properties.creator.objectId
if ($createdById) {
$aadUser = Get-AzureADUser -ObjectId $createdById
$ownerUPN = $aadUser.UserPrincipalName
$ownerDisplayName = $aadUser.DisplayName
}
} catch {
$ownerUPN = "Unable to resolve"
$ownerDisplayName = "Unable to resolve"
}