Skip to content

Commit

Permalink
Merge pull request #930 from cvitale/main
Browse files Browse the repository at this point in the history
Fixing string append on the right variables
  • Loading branch information
TomJanetscheck authored Jan 13, 2025
2 parents 350c5f0 + c209284 commit 4bb9186
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ if ($mode.ToLower() -eq "rg") {

$vmssUrl = "https://management.azure.com/subscriptions/" + $SubscriptionId + "/resources?`$filter=resourceType eq 'Microsoft.Compute/virtualMachineScaleSets'&api-version=2021-04-01"
do{
$vmssResponse += Invoke-RestMethod -Method Get -Uri $vmssUrl -Headers @{Authorization = "Bearer $accessToken"}
$vmssResponseMachines = $vmssResponse.value | where {$_.tags.$tagName -eq $tagValue}
$vmssResponse = Invoke-RestMethod -Method Get -Uri $vmssUrl -Headers @{Authorization = "Bearer $accessToken"}
$vmssResponseMachines += $vmssResponse.value | where {$_.tags.$tagName -eq $tagValue}
$vmssUrl = $vmssResponse.nextLink
} while (![string]::IsNullOrEmpty($vmssUrl))

$arcUrl = "https://management.azure.com/subscriptions/" + $SubscriptionId + "/resources?`$filter=resourceType eq 'Microsoft.HybridCompute/machines'&api-version=2023-07-01"
do{
$arcResponse += Invoke-RestMethod -Method Get -Uri $arcUrl -Headers @{Authorization = "Bearer $accessToken"}
$arcResponseMachines = $arcResponse.value | where {$_.tags.$tagName -eq $tagValue}
$arcResponse = Invoke-RestMethod -Method Get -Uri $arcUrl -Headers @{Authorization = "Bearer $accessToken"}
$arcResponseMachines += $arcResponse.value | where {$_.tags.$tagName -eq $tagValue}
$arcUrl = $arcResponse.nextLink
} while (![string]::IsNullOrEmpty($arcUrl))
}
Expand Down

0 comments on commit 4bb9186

Please sign in to comment.