Skip to content

Remove-FlowUserDetails

PowerApps Admin: Removes flow user details

#Requires -Version 5.1
#Requires -Modules Microsoft.PowerApps.Administration.PowerShell

[CmdletBinding()]
Param(
    [Parameter(Mandatory = $true)]
    [pscredential]$PACredential,

    [Parameter(Mandatory = $true)]
    [string]$UserId,

    [string]$ApiVersion
)

Process {
    try {
        ConnectPowerApps -PAFCredential $PACredential
        $args = @{ ErrorAction = 'Stop'; UserId = $UserId }
        if ($PSBoundParameters.ContainsKey('ApiVersion')) { $args.Add('ApiVersion', $ApiVersion) }
        Remove-AdminFlowUserDetails @args -ErrorAction Stop
        [PSCustomObject]@{ Timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"; Status = "Success"; Message = "Flow user details removed for '$UserId'" }
    }
    catch { throw }
    finally { DisconnectPowerApps }
}

PowerApps credentials

The user ID to remove from the flow

API version to call

An interactive directory of PowerShell scripts.