@@ -365,14 +365,14 @@ Param
365365 $Product = ' AzGovViz' ,
366366
367367 [string ]
368- $ProductVersion = ' 6.4.3 ' ,
368+ $ProductVersion = ' 6.4.4 ' ,
369369
370370 [string ]
371371 $GithubRepository = ' aka.ms/AzGovViz' ,
372372
373373 # <--- AzAPICall related parameters #consult the AzAPICall GitHub repository for details aka.ms/AzAPICall
374374 [string ]
375- $AzAPICallVersion = ' 1.2.0 ' ,
375+ $AzAPICallVersion = ' 1.2.1 ' ,
376376
377377 [switch ]
378378 $DebugAzAPICall ,
@@ -627,7 +627,7 @@ Param
627627 $MSTenantIds = @ (' 2f4a9838-26b7-47ee-be60-ccc1fdec5953' , ' 33e01921-4d64-4f8c-a055-5bdaffd5e33d' ),
628628
629629 [array ]
630- $ValidPolicyEffects = @ (' append' , ' audit' , ' auditIfNotExists' , ' deny' , ' denyAction' , ' deployIfNotExists' , ' modify' , ' manual' , ' disabled' , ' EnforceRegoPolicy' , ' enforceSetting' )
630+ $ValidPolicyEffects = @ (' append' , ' audit' , ' auditIfNotExists' , ' deny' , ' denyAction' , ' deployIfNotExists' , ' modify' , ' manual' , ' disabled' , ' EnforceRegoPolicy' , ' enforceSetting' , ' Mutate ' )
631631)
632632
633633$Error.clear ()
@@ -648,6 +648,7 @@ if ($ManagementGroupId -match ' ') {
648648}
649649
650650# region Functions
651+ . " .\$ ( $ScriptPath ) \functions\getPrivateEndpointCapableResourceTypes.ps1"
651652. " .\$ ( $ScriptPath ) \functions\validateLeastPrivilegeForUser.ps1"
652653. " .\$ ( $ScriptPath ) \functions\getPolicyRemediation.ps1"
653654. " .\$ ( $ScriptPath ) \functions\getPolicyHash.ps1"
@@ -820,14 +821,14 @@ if (-not $ignoreARMLocation) {
820821# EndRegion initAZAPICall
821822
822823# region required AzAPICall version
823- if (-not ([System.Version ]" $ ( $azapicallConf [' htParameters' ].azAPICallModuleVersion) " -ge [System.Version ]' 1.1.84 ' )) {
824+ if (-not ([System.Version ]" $ ( $azapicallConf [' htParameters' ].azAPICallModuleVersion) " -ge [System.Version ]' 1.2.1 ' )) {
824825 Write-Host ' '
825826 Write-Host ' Azure Governance Visualizer version ' $ProductVersion ' - AzAPICall PowerShell module version check failed -> https://aka.ms/AzAPICall; https://www.powershellgallery.com/packages/AzAPICall'
826- throw " This version of Azure Governance Visualizer '$ProductVersion ' requires AzAPICall PowerShell module version '1.1.84 ' or greater"
827+ throw " This version of Azure Governance Visualizer '$ProductVersion ' requires AzAPICall PowerShell module version '1.2.1 ' or greater"
827828}
828829else {
829830 Write-Host ' '
830- Write-Host " Azure Governance Visualizer version '$ProductVersion ' - AzAPICall PowerShell module version requirement check succeeded: '1.1.84 ' or greater - current: '$ ( $azapicallConf [' htParameters' ].azAPICallModuleVersion) ' " - ForegroundColor Green
831+ Write-Host " Azure Governance Visualizer version '$ProductVersion ' - AzAPICall PowerShell module version requirement check succeeded: '1.2.1 ' or greater - current: '$ ( $azapicallConf [' htParameters' ].azAPICallModuleVersion) ' " - ForegroundColor Green
831832}
832833# endregion required AzAPICall version
833834
@@ -1160,93 +1161,7 @@ if (-not $HierarchyMapOnly) {
11601161 Write-Host " Getting Tenant Resource Providers duration: $ ( (New-TimeSpan - Start $startGetRPs - End $endGetRPs ).TotalMinutes) minutes ($ ( (New-TimeSpan - Start $startGetRPs - End $endGetRPs ).TotalSeconds) seconds)"
11611162 # endregion Getting Tenant Resource Providers
11621163
1163- # region Getting Available Private Endpoint Types
1164- $startGetAvailablePrivateEndpointTypes = Get-Date
1165- $privateEndpointAvailabilityCheckCompleted = $false
1166- $subsToProcessForGettingPrivateEndpointTypes = [System.Collections.ArrayList ]@ ()
1167- $prioCounter = 0
1168- foreach ($subscription in $subsToProcessInCustomDataCollection ) {
1169- $prioCounter ++
1170- if ($subscription.subscriptionId -eq $azAPICallConf [' checkcontext' ].Subscription.Id) {
1171- $null = $subsToProcessForGettingPrivateEndpointTypes.Add ([PSCustomObject ]@ {
1172- subscriptionInfo = $subscription
1173- prio = 0
1174- })
1175- }
1176- else {
1177- $null = $subsToProcessForGettingPrivateEndpointTypes.Add ([PSCustomObject ]@ {
1178- subscriptionInfo = $subscription
1179- prio = $prioCounter
1180- })
1181- }
1182- }
1183-
1184- foreach ($subscription in $subsToProcessForGettingPrivateEndpointTypes | Sort-Object - Property prio) {
1185-
1186- if ($privateEndpointAvailabilityCheckCompleted ) {
1187- continue
1188- }
1189-
1190- $subscriptionId = $subscription.subscriptionInfo.subscriptionId
1191- $subscriptionName = $subscription.subscriptionInfo.subscriptionName
1192-
1193- $currentTask = " Getting Locations for Subscription '$ ( $subscriptionName ) ' ($ ( $subscriptionId ) )"
1194- Write-Host $currentTask
1195- $uri = " $ ( $azAPICallConf [' azAPIEndpointUrls' ].ARM) /subscriptions/$ ( $subscriptionId ) /locations?api-version=2020-01-01"
1196- $method = ' GET'
1197- $getLocations = AzAPICall - AzAPICallConfiguration $azAPICallConf - uri $uri - method $method - currentTask $currentTask
1198- Write-Host " Returned $ ( $getLocations.Count ) locations"
1199-
1200- Write-Host " Getting 'Available Private Endpoint Types' for Subscription '$ ( $subscriptionName ) ' ($ ( $subscriptionId ) ) for $ ( $getLocations.Count ) locations"
1201-
1202- $batchSize = [math ]::ceiling($getLocations.Count / $ThrottleLimit )
1203- Write-Host " Optimal batch size: $ ( $batchSize ) "
1204- $counterBatch = [PSCustomObject ] @ { Value = 0 }
1205- $getLocationsBatch = ($getLocations ) | Group-Object - Property { [math ]::Floor($counterBatch.Value ++ / $batchSize ) }
1206- Write-Host " Processing data in $ ( $getLocationsBatch.Count ) batches"
1207-
1208- $getLocationsBatch | ForEach-Object - Parallel {
1209- $subscriptionId = $using :subscriptionId
1210- $azAPICallConf = $using :azAPICallConf
1211- $htAvailablePrivateEndpointTypes = $using :htAvailablePrivateEndpointTypes
1212-
1213- foreach ($location in $_.Group ) {
1214- $currentTask = " Getting 'Available Private Endpoint Types' for location $ ( $location.name ) "
1215- # Write-Host $currentTask
1216- $uri = " $ ( $azAPICallConf [' azAPIEndpointUrls' ].ARM) /subscriptions/$ ( $subscriptionId ) /providers/Microsoft.Network/locations/$ ( $location.name ) /availablePrivateEndpointTypes?api-version=2022-07-01"
1217- $method = ' GET'
1218- $availablePrivateEndpointTypes = AzAPICall - AzAPICallConfiguration $azAPICallConf - uri $uri - method $method - currentTask $currentTask - skipOnErrorCode 400 , 409
1219- Write-Host " Returned $ ( $availablePrivateEndpointTypes.Count ) 'Available Private Endpoint Types' for location $ ( $location.name ) "
1220- foreach ($availablePrivateEndpointType in $availablePrivateEndpointTypes ) {
1221- if (-not $htAvailablePrivateEndpointTypes .(($availablePrivateEndpointType.resourceName ).ToLower())) {
1222- $script :htAvailablePrivateEndpointTypes .(($availablePrivateEndpointType.resourceName ).ToLower()) = @ {}
1223- }
1224- }
1225- }
1226- } - ThrottleLimit $ThrottleLimit
1227-
1228- if ($htAvailablePrivateEndpointTypes.Keys.Count -gt 0 ) {
1229- # Write-Host " Created ht for $($htAvailablePrivateEndpointTypes.Keys.Count) 'Available Private Endpoint Types'"
1230- $privateEndpointAvailabilityCheckCompleted = $true
1231- }
1232- else {
1233- Write-Host " $ ( $htAvailablePrivateEndpointTypes.Keys.Count ) 'Available Private Endpoint Types' - likely the Resource Provider 'Microsoft.Network' is not registered - trying next available subscription"
1234- $privateEndpointAvailabilityCheckCompleted = $false
1235- }
1236- }
1237-
1238- if ($htAvailablePrivateEndpointTypes.Keys.Count -gt 0 ) {
1239- Write-Host " Created ht for $ ( $htAvailablePrivateEndpointTypes.Keys.Count ) 'Available Private Endpoint Types'"
1240- }
1241- else {
1242- $throwmsg = " $ ( $htAvailablePrivateEndpointTypes.Keys.Count ) 'Available Private Endpoint Types' - Checked for $ ( $subsToProcessForGettingPrivateEndpointTypes.Count ) Subscriptions with no success. Make sure that for at least one Subscription the Resource Provider 'Microsoft.Network' is registered. Once you registered the Resource Provider for Subscription 'subscriptionEnabled' it may be a good idea to use the parameter: -SubscriptionId4AzContext '<subscriptionId of subscriptionEnabled>'"
1243- Write-Host $throwmsg - ForegroundColor DarkRed
1244- Throw $throwmsg
1245- }
1246-
1247- $endGetAvailablePrivateEndpointTypes = Get-Date
1248- Write-Host " Getting 'Available Private Endpoint Types' duration: $ ( (New-TimeSpan - Start $startGetAvailablePrivateEndpointTypes - End $endGetAvailablePrivateEndpointTypes ).TotalMinutes) minutes ($ ( (New-TimeSpan - Start $startGetAvailablePrivateEndpointTypes - End $endGetAvailablePrivateEndpointTypes ).TotalSeconds) seconds)"
1249- # endregion Getting Available Private Endpoint Types
1164+ getPrivateEndpointCapableResourceTypes
12501165 }
12511166
12521167 Write-Host ' Collecting custom data'
0 commit comments