functions/roleManagement/Test-TmfRoleManagement.ps1
function Test-TmfRoleManagement { [CmdletBinding()] Param () begin { Test-GraphConnection -Cmdlet $PSCmdlet $tenant = Get-MgOrganization -Property displayName, Id $roleManagementResources = @("roleAssignments", "roleDefinitions", "roleManagementPolicies") } process { Write-PSFMessage -Level Host -FunctionName "Test-TmfRoleManagement" -String "TMF.TenantInformation" -StringValues $tenant.displayName, $tenant.Id foreach ($resourceType in ($script:supportedResources.GetEnumerator() | Where-Object {$_.Value.testFunction -and $_.Name -in $roleManagementResources} | Sort-Object {$_.Value.weight})) { if ($script:desiredConfiguration[$resourceType.Name]) { Write-PSFMessage -Level Host -FunctionName "Test-TmfRoleManagement" -String "TMF.StartingTestForResource" -StringValues $resourceType.Name & $resourceType.Value["testFunction"] -Cmdlet $PSCmdlet | Beautify-TmfTestResult } } } end { } } |