Skip to content

Commit e2cfbc1

Browse files
committed
Updates to websites git integration
1 parent e9b86e8 commit e2cfbc1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

experiments/Websites.Experiments/AzureRM.Websites.Experiments.psm1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,11 +313,12 @@ function Add-Remote
313313
$ErrorActionPreference = 'Stop'
314314
# Get app-level deployment credentials
315315
$xml = [xml](Get-AzureRmWebAppPublishingProfile -Name $WebApp.Name -ResourceGroupName $WebApp.ResourceGroup -OutputFile null)
316-
$username = $xml.SelectNodes("//publishProfile[@publishMethod=`"MSDeploy`"]/@userName").value
317-
$password = $xml.SelectNodes("//publishProfile[@publishMethod=`"MSDeploy`"]/@userPWD").value
316+
$username = [System.Uri]::EscapeDataString($xml.SelectNodes("//publishProfile[@publishMethod=`"MSDeploy`"]/@userName").value)
317+
$password = [System.Uri]::EscapeDataString($xml.SelectNodes("//publishProfile[@publishMethod=`"MSDeploy`"]/@userPWD").value)
318318
$remoteName = "azure"
319+
$url = ("https://$username" + ':' + "$password@$($WebApp.EnabledHostNames[1])")
319320
# Add the Azure remote to a local Git respository
320-
$command = "git -C $GitRepositoryPath remote add $remoteName 'https://${username}:$password@$($WebApp.EnabledHostNames[0])'" + " 2> $gitOutput"
321+
$command = "git -C $GitRepositoryPath remote add $remoteName $url"
321322
Invoke-Expression -Command $command | Out-Null
322323
if ($gitOutPut) {
323324
$repoAdded = $false

0 commit comments

Comments
 (0)