Last active
June 18, 2020 10:55
-
-
Save pmatthews05/7186d376fe42c4cdf75a6981cb7f0ef4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Get all permissions for the Application Registration | |
$currentPermissionCollection = @(az ad app permission list --id $AppId | ConvertFrom-Json) | |
#Remove the permissions (resourceAppId) for the Application Registration | |
$currentPermissionCollection | ForEach-Object { | |
$permission = $PSItem | |
if ($permission.Count -eq 0) { return } | |
$permission.resourceAppId | ForEach-Object{ | |
$resourceAppId = $PSItem | |
az ad app permission delete --id $AppId --api $resourceAppId | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment