Skip to content

Commit

Permalink
Fix Url being printed with non-encoded spaces (#12)
Browse files Browse the repository at this point in the history
* Fix Uri encoding

* Replace Get-AzTenant with Get-AzContext
  • Loading branch information
SimonWahlin authored Jan 8, 2024
1 parent 90a270d commit f9d7a2e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions orchestration/scripts/Invoke-Helper.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -672,10 +672,10 @@ function Show-ManagementGroupInfo {
$parDeploymentPrefix = $parParameters.parDeploymentPrefix.value
$parTopLevelManagementGroupName = $parParameters.parTopLevelManagementGroupName.value
$parDeploymentSuffix = $parParameters.parDeploymentSuffix.value
$varTenantId = (Get-AzTenant).Id
$varMgName = $parTopLevelManagementGroupName -replace ' ', '%20'
$varTenantId = (Get-AzContext).Tenant.Id
$varManagementGroupLink = "$varAzPortalLink/#view/Microsoft_Azure_ManagementGroups/ManagmentGroupDrilldownMenuBlade/~/overview/tenantId/$varTenantId"
$varManagementGroupLink = "$varManagementGroupLink/mgId/$parDeploymentPrefix$parDeploymentSuffix/mgDisplayName/$varMgName/mgCanAddOrMoveSubscription~/true/mgParentAccessLevel/Owner/defaultMenuItemId/overview/drillDownMode~/true"
$varManagementGroupLink = "$varManagementGroupLink/mgId/$parDeploymentPrefix$parDeploymentSuffix/mgDisplayName/$parTopLevelManagementGroupName/mgCanAddOrMoveSubscription~/true/mgParentAccessLevel/Owner/defaultMenuItemId/overview/drillDownMode~/true"
$varManagementGroupLink = [System.Uri]::EscapeUriString($varManagementGroupLink)
$varManagementGroupInfo = "If you want to learn more about your management group, please click following link.`n`n"
$varManagementGroupInfo = "$varManagementGroupInfo$varManagementGroupLink`n`n"

Expand Down

0 comments on commit f9d7a2e

Please sign in to comment.