Skip to content
Merged
Show file tree
Hide file tree
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 @@ -359,6 +359,7 @@ jobs:
DeploymentName = '$(deploymentName)'
TemplateFilePath = $templateFilePath
ResourceGroupName = '${{ parameters.resourceGroupName }}'
subscriptionId = '${{ parameters.subscriptionId }}'
ManagementGroupId = '${{ parameters.managementGroupId }}'
Verbose = $true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ function Initialize-DeploymentRemoval {
[Parameter(Mandatory = $false)]
[string] $ResourceGroupName,

[Parameter(Mandatory = $false)]
[string] $subscriptionId,

[Parameter(Mandatory = $false)]
[string] $ManagementGroupId
)
Expand All @@ -47,6 +50,12 @@ function Initialize-DeploymentRemoval {
}

process {

if (-not [String]::IsNullOrEmpty($subscriptionId)) {
Write-Verbose ('Setting context to subscription [{0}]' -f $subscriptionId)
$null = Set-AzContext -Subscription $subscriptionId
}

$moduleName = Split-Path (Split-Path $templateFilePath -Parent) -LeafBase

# The initial sequence is a general order-recommendation
Expand Down