From f9d7a2e535ba3bd9468697947a528e2f034a444e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20W=C3=A5hlin?= Date: Mon, 8 Jan 2024 22:28:38 +0100 Subject: [PATCH] Fix Url being printed with non-encoded spaces (#12) * Fix Uri encoding * Replace Get-AzTenant with Get-AzContext --- orchestration/scripts/Invoke-Helper.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/orchestration/scripts/Invoke-Helper.ps1 b/orchestration/scripts/Invoke-Helper.ps1 index 8ec6dcff..e201fd3e 100644 --- a/orchestration/scripts/Invoke-Helper.ps1 +++ b/orchestration/scripts/Invoke-Helper.ps1 @@ -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"