Skip to content

Set-BlockTenantFromConsentPlans

PowerApps Admin: Blocks tenant from consent plans

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

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

    [string]$ApiVersion
)

Process {
    try {
        ConnectPowerApps -PAFCredential $PACredential
        $args = @{ ErrorAction = 'Stop' }
        if ($PSBoundParameters.ContainsKey('ApiVersion')) { $args.Add('ApiVersion', $ApiVersion) }
        $null = Set-AdminPowerAppBlockTenantFromConsentPlans @args -ErrorAction Stop
        [PSCustomObject]@{ Timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"; Status = "Success"; Message = "Tenant blocked from consent plans" }
    }
    catch { throw }
    finally { DisconnectPowerApps }
}

PowerApps credentials for authentication

API version to call

An interactive directory of PowerShell scripts.