Public/Get-RBACProvider.ps1
|
function Get-RBACProvider { <# .SYNOPSIS Lists the registered RBAC probe providers (platforms). .DESCRIPTION Returns the distinct providers registered with the module: their canonical name, accepted aliases, whether they support live probing, and whether they support live guardrail (gate / block) detection. Useful for discovering valid -Platform values, which platforms can derive a requirement from a live failure (only Azure, today), and which can detect blockers live (Azure and Microsoft Graph). .PARAMETER Platform Optional name or alias to resolve a single provider. .EXAMPLE Get-RBACProvider .EXAMPLE Get-RBACProvider -Platform Fabric .OUTPUTS PSCustomObject with Name, Aliases, SupportsLiveProbe, SupportsGuardProbe. #> [CmdletBinding()] [OutputType([pscustomobject])] param( [Parameter()] [string]$Platform ) Write-PSFMessage -Level Debug -Message "Get-RBACProvider: listing provider(s)$(if ($Platform) { " matching '$Platform'" })." -Tag 'PSAutoRBAC', 'Public' $providers = if ($Platform) { @(Get-RBACProviderInternal -Platform $Platform) } else { @(Get-RBACRegisteredProvider) } foreach ($p in $providers) { [pscustomobject]@{ PSTypeName = 'PSAutoRBAC.ProviderInfo' Name = $p.Name Aliases = $p.Aliases SupportsLiveProbe = $p.SupportsLiveProbe SupportsGuardProbe = [bool]($p.PSObject.Properties.Name -contains 'SupportsGuardProbe' -and $p.SupportsGuardProbe) } } } |