Skip to content

Commit

Permalink
Merge pull request #226 from JulianHayward/optWhereObject
Browse files Browse the repository at this point in the history
6.4.2
  • Loading branch information
JulianHayward authored Mar 16, 2024
2 parents 971553a + b0041b8 commit 6905e6f
Show file tree
Hide file tree
Showing 9 changed files with 89 additions and 89 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ As an alternative, you can use the [Azure Governance Visualizer accelerator](htt

## Release history

__Changes__ (2024-Mar-14 / 6.4.1 Minor)
__Changes__ (2024-Mar-14 / 6.4.2 Minor)

* optimize objects handling / best practices

Expand Down
2 changes: 1 addition & 1 deletion history.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### Azure Governance Visualizer version 6

__Changes__ (2024-Mar-14 / 6.4.1 Minor)
__Changes__ (2024-Mar-14 / 6.4.2 Minor)

* optimize objects handling / best practices

Expand Down
86 changes: 43 additions & 43 deletions pwsh/AzGovVizParallel.ps1

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pwsh/dev/devAzGovVizParallel.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@
Note if you use parameter -LargeTenant then parameter -NoScopeInsights will be set to true
PS C:\>.\AzGovVizParallel.ps1 -ManagementGroupId <your-Management-Group-Id> -NoScopeInsights
Defines the limit (default=500) of Microsoft Entra group members; For groups that have more members than the defined limit group members will not be resolved
Defines the limit (default=500) of Microsoft Entra group members; For groups that have more members than the defined limit group members will not be resolved
PS C:\>.\AzGovVizParallel.ps1 -ManagementGroupId <your-Management-Group-Id> -AADGroupMembersLimit 750
Will speed up the processing time but information like Resource diagnostics capability, resource type stats, UserAssigned Identities assigned to Resources is excluded (featured for large tenants)
Expand Down Expand Up @@ -365,7 +365,7 @@ Param
$Product = 'AzGovViz',

[string]
$ProductVersion = '6.4.1',
$ProductVersion = '6.4.2',

[string]
$GithubRepository = 'aka.ms/AzGovViz',
Expand Down
2 changes: 1 addition & 1 deletion pwsh/dev/functions/getTenantDetails.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function getTenantDetails {
$tenantDetailsResult = AzAPICall -AzAPICallConfiguration $azAPICallConf -uri $uri -method $method -currentTask $currentTask

if (($tenantDetailsResult).count -gt 0) {
$tenantDetails = $tenantDetailsResult | Where-Object { $_.tenantId -eq ($azAPICallConf['checkContext']).Tenant.Id }
$tenantDetails = $tenantDetailsResult.where({ $_.tenantId -eq ($azAPICallConf['checkContext']).Tenant.Id })
if ($tenantDetails.displayName) {
$script:tenantDisplayName = $tenantDetails.displayName
Write-Host " Tenant DisplayName: $tenantDisplayName"
Expand Down
14 changes: 7 additions & 7 deletions pwsh/dev/functions/processDataCollection.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -918,11 +918,11 @@ function processDataCollection {
$method = 'GET'
$upperScopesPolicyAssignments = AzAPICall -AzAPICallConfiguration $azAPICallConf -uri $uri -method $method -currentTask $currentTask -caller 'CustomDataCollection'

$upperScopesPolicyAssignments = $upperScopesPolicyAssignments | Where-Object { $_.properties.scope -ne "/providers/Microsoft.Management/managementGroups/$($ManagementGroupId)" }
$upperScopesPolicyAssignmentsPolicyCount = (($upperScopesPolicyAssignments | Where-Object { $_.properties.policyDefinitionId -match '/providers/Microsoft.Authorization/policyDefinitions/' })).count
$upperScopesPolicyAssignmentsPolicySetCount = (($upperScopesPolicyAssignments | Where-Object { $_.properties.policyDefinitionId -match '/providers/Microsoft.Authorization/policySetDefinitions/' })).count
$upperScopesPolicyAssignmentsPolicyAtScopeCount = (($upperScopesPolicyAssignments | Where-Object { $_.properties.policyDefinitionId -match '/providers/Microsoft.Authorization/policyDefinitions/' -and $_.Id -match "/providers/Microsoft.Management/managementGroups/$($ManagementGroupId)" })).count
$upperScopesPolicyAssignmentsPolicySetAtScopeCount = (($upperScopesPolicyAssignments | Where-Object { $_.properties.policyDefinitionId -match '/providers/Microsoft.Authorization/policySetDefinitions/' -and $_.Id -match "/providers/Microsoft.Management/managementGroups/$($ManagementGroupId)" })).count
$upperScopesPolicyAssignments = $upperScopesPolicyAssignments.where({ $_.properties.scope -ne "/providers/Microsoft.Management/managementGroups/$($ManagementGroupId)" })
$upperScopesPolicyAssignmentsPolicyCount = (($upperScopesPolicyAssignments.where({ $_.properties.policyDefinitionId -match '/providers/Microsoft.Authorization/policyDefinitions/' }))).count
$upperScopesPolicyAssignmentsPolicySetCount = (($upperScopesPolicyAssignments.where({ $_.properties.policyDefinitionId -match '/providers/Microsoft.Authorization/policySetDefinitions/' }))).count
$upperScopesPolicyAssignmentsPolicyAtScopeCount = (($upperScopesPolicyAssignments.where({ $_.properties.policyDefinitionId -match '/providers/Microsoft.Authorization/policyDefinitions/' -and $_.Id -match "/providers/Microsoft.Management/managementGroups/$($ManagementGroupId)" }))).count
$upperScopesPolicyAssignmentsPolicySetAtScopeCount = (($upperScopesPolicyAssignments.where({ $_.properties.policyDefinitionId -match '/providers/Microsoft.Authorization/policySetDefinitions/' -and $_.Id -match "/providers/Microsoft.Management/managementGroups/$($ManagementGroupId)" }))).count
$upperScopesPolicyAssignmentsPolicyAndPolicySetAtScopeCount = ($upperScopesPolicyAssignmentsPolicyAtScopeCount + $upperScopesPolicyAssignmentsPolicySetAtScopeCount)
foreach ($L0mgmtGroupPolicyAssignment in $upperScopesPolicyAssignments) {

Expand Down Expand Up @@ -1204,10 +1204,10 @@ function processDataCollection {
#$upperScopesRoleAssignments = GetRoleAssignments -Scope "/providers/Microsoft.Management/managementGroups/$($ManagementGroupId)" -scopeDetails "getRoleAssignments upperScopes (Mg)"
$upperScopesRoleAssignments = $roleAssignmentsFromAPI

$upperScopesRoleAssignmentsLimitUtilization = (($upperScopesRoleAssignments | Where-Object { $_.properties.scope -eq "/providers/Microsoft.Management/managementGroups/$($ManagementGroupId)" })).count
$upperScopesRoleAssignmentsLimitUtilization = (($upperScopesRoleAssignments.where({ $_.properties.scope -eq "/providers/Microsoft.Management/managementGroups/$($ManagementGroupId)" }))).count
#tenantLevelRoleAssignments
if (-not $htMgAtScopeRoleAssignments.'tenantLevelRoleAssignments') {
$tenantLevelRoleAssignmentsCount = (($upperScopesRoleAssignments | Where-Object { $_.id -like '/providers/Microsoft.Authorization/roleAssignments/*' })).count
$tenantLevelRoleAssignmentsCount = (($upperScopesRoleAssignments.where({ $_.id -like '/providers/Microsoft.Authorization/roleAssignments/*' }))).count
$htMgAtScopeRoleAssignments.'tenantLevelRoleAssignments' = @{
AssignmentsCount = $tenantLevelRoleAssignmentsCount
}
Expand Down
4 changes: 2 additions & 2 deletions pwsh/dev/functions/processDiagramMermaid.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ $mgInLevel(`"$mgNameId`") --> SubsOf$mgInLevel(`"$(($subsUnderMg | Measure-Objec
}

if (($script:outOfScopeSubscriptions | Measure-Object).count -gt 0) {
$subsoosUnderMg = ($outOfScopeSubscriptions | Where-Object { $_.Level -eq $mgLevel -and $_.ManagementGroupId -eq $mgInLevel }).SubscriptionId | Get-Unique
$subsoosUnderMg = ($outOfScopeSubscriptions.where({ $_.Level -eq $mgLevel -and $_.ManagementGroupId -eq $mgInLevel })).SubscriptionId | Get-Unique
if (($subsoosUnderMg | Measure-Object).count -gt 0) {
foreach ($subUnderMg in $subsoosUnderMg) {
$null = $script:arraySubsOos.Add("SubsoosOf$mgInLevel")
$mgDetalsN = ($optimizedTableForPathQueryMg.where( { $_.Level -eq $mgLevel -and $_.ManagementGroupId -eq $mgInLevel } ))
$mgName = $mgDetalsN.MgName | Get-Unique
}
$mgName = ($outOfScopeSubscriptions | Where-Object { $_.Level -eq $mgLevel -and $_.ManagementGroupId -eq $mgInLevel }).ManagementGroupName | Get-Unique
$mgName = ($outOfScopeSubscriptions.where({ $_.Level -eq $mgLevel -and $_.ManagementGroupId -eq $mgInLevel })).ManagementGroupName | Get-Unique
if ($mgName -eq $mgInLevel) {
$mgNameId = $mgName
}
Expand Down
Loading

0 comments on commit 6905e6f

Please sign in to comment.