Skip to content

Commit a958ce2

Browse files
authored
Update
1 parent 2e5dd1d commit a958ce2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/internal/functions/Search-AzOpsAzGraph.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
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 {
@@ -74,7 +74,7 @@
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 {
@@ -88,13 +88,13 @@
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
@@ -238,7 +238,7 @@
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

0 commit comments

Comments
 (0)