File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 6060 process {
6161 Write-AzOpsMessage - LogLevel Verbose - LogString ' Search-AzOpsAzGraph.Processing' - LogStringValues $Query
6262 $results = [System.Collections.Generic.List [object ]]::new()
63-
63+
6464 if ($UseTenantScope ) {
6565 Write-AzOpsMessage - LogLevel Verbose - LogString ' Search-AzOpsAzGraph.Processing.UseTenantScope'
6666 try {
7474 Write-AzOpsMessage - LogLevel Error - LogString ' Search-AzOpsAzGraph.Processing.UseTenantScope.Failed' - LogStringValues $Query , $_.Exception.Message
7575 }
7676 }
77-
77+
7878 if ($ManagementGroupName ) {
7979 Write-AzOpsMessage - LogLevel Verbose - LogString ' Search-AzOpsAzGraph.Processing.ManagementGroup' - LogStringValues $ManagementGroupName
8080 try {
8888 Write-AzOpsMessage - LogLevel Error - LogString ' Search-AzOpsAzGraph.Processing.ManagementGroup.Failed' - LogStringValues $Query , $ManagementGroupName , $_.Exception.Message
8989 }
9090 }
91-
91+
9292 if ($Subscription ) {
9393 # Create a counter, set the batch size, and prepare a variable for the results
94- $counter = 0
94+ $counter = [ PSCustomObject ] @ { Value = 0 }
9595 $batchSize = 1000
9696 # Group subscriptions into batches to conform with graph limits
97- $subscriptionBatch = $Subscription | Group-Object - Property { [math ]::Floor($counter ++ / $batchSize ) }
97+ $subscriptionBatch = $Subscription | Group-Object - Property { [math ]::Floor($counter.Value ++ / $batchSize ) }
9898 foreach ($group in $subscriptionBatch ) {
9999 $subscriptionIds = ($group.Group ).Id -join ' , '
100100 $subscriptionCount = $group.Group.Count
238238 }
239239 }
240240 }
241-
241+
242242 $resultsType = [System.Collections.Generic.List [object ]]::new()
243243 foreach ($result in $results ) {
244244 # Add null check for result.type property
You can’t perform that action at this time.
0 commit comments