Functions/Get-SecretScopes.ps1
Function Get-SecretScopes { [cmdletbinding()] param ( [parameter(Mandatory = $false)][string]$BearerToken, [parameter(Mandatory = $false)][string]$Region, [parameter(Mandatory = $false)][string]$ScopeName ) if ($BearerToken -and $Region) { $workspaceScopes = Get-DatabricksSecretScopes -BearerToken $BearerToken -Region $Region } else { $workspaceScopes = Get-DatabricksSecretScopes } if ($ScopeName) { Return ($workspaceScopes | where-object { $_.name -eq "$ScopeName" }) } else { return $workspaceScopes } } |