Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,14 @@ function Get-DeploymentTargetResourceListInner {
[array]$resultSet = $resultSet | Where-Object { $_ -ne $deployment }
if ($deployment -match '/subscriptions/') {
# Subscription Level Child Deployments
[array]$resultSet += Get-DeploymentTargetResourceListInner -Name (Split-Path $deployment -Leaf) -Scope 'subscription'
if ($deployment -match '/resourceGroups/') {
# Resource Group Level Child Deployments (Used only if management group scope --> resource Group scope)
$name = Split-Path $deployment -Leaf
$resourceGroupName = $deployment.split('/resourceGroups/')[1].Split('/')[0]
[array]$resultSet += Get-DeploymentTargetResourceListInner -Name $name -ResourceGroupName $ResourceGroupName -Scope 'resourcegroup'
} else {
[array]$resultSet += Get-DeploymentTargetResourceListInner -Name (Split-Path $deployment -Leaf) -Scope 'subscription'
}
} else {
# Management Group Level Deployments
[array]$resultSet += Get-DeploymentTargetResourceListInner -name (Split-Path $deployment -Leaf) -scope 'managementgroup' -ManagementGroupId $ManagementGroupId
Expand Down