Skip to content

Removed whitespace in logging commands #20939

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion Tasks/AzurePowerShellV4/InitializeAz.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ if ($endpointObject.scheme -eq 'ServicePrincipal') {
$TenantId = $endpointObject.tenantId
$additional = @{ TenantId = $TenantId }

Write-Host "##[command] Set-AzContext -SubscriptionId $SubscriptionId $(Format-Splat $additional)"
Write-Host "##[command]Set-AzContext -SubscriptionId $SubscriptionId $(Format-Splat $additional)"
$null = Set-AzContext -SubscriptionId $SubscriptionId @additional
}
}
Expand Down
4 changes: 2 additions & 2 deletions Tasks/AzurePowerShellV4/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 4,
"Minor": 254,
"Patch": 1
"Minor": 256,
"Patch": 0
},
"releaseNotes": "Added support for Az Module and cross platform agents.",
"groups": [
Expand Down
4 changes: 2 additions & 2 deletions Tasks/AzurePowerShellV4/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 4,
"Minor": 254,
"Patch": 1
"Minor": 256,
"Patch": 0
},
"releaseNotes": "ms-resource:loc.releaseNotes",
"groups": [
Expand Down
6 changes: 3 additions & 3 deletions Tasks/AzurePowerShellV5/InitializeAz.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -100,21 +100,21 @@ if ($endpointObject.scheme -eq 'ServicePrincipal') {
$TenantId = $endpointObject.tenantId
$additional = @{ TenantId = $TenantId }

Write-Host "##[command] Set-AzContext -SubscriptionId $SubscriptionId $(Format-Splat $additional)"
Write-Host "##[command]Set-AzContext -SubscriptionId $SubscriptionId $(Format-Splat $additional)"
$null = Set-AzContext -SubscriptionId $SubscriptionId @additional
}
}
elseif ($endpointObject.scheme -eq 'WorkloadIdentityFederation') {
Write-Verbose "Using WorkloadIdentityFederation authentication scheme"

$logStr = "##[command] Connect-AzAccount -ServicePrincipal -Tenant $($endpointObject.tenantId) -ApplicationId $($endpointObject.servicePrincipalClientID)"
$logStr = "##[command]Connect-AzAccount -ServicePrincipal -Tenant $($endpointObject.tenantId) -ApplicationId $($endpointObject.servicePrincipalClientID)"
$logStr += " -FederatedToken ***** -Environment $environmentName -Scope Process"
Write-Host $logStr
$null = Connect-AzAccount -ServicePrincipal -Tenant $endpointObject.tenantId -ApplicationId $endpointObject.servicePrincipalClientID `
-FederatedToken $clientAssertionJwt -Environment $environmentName -Scope 'Process'

if ($scopeLevel -ne "ManagementGroup") {
Write-Host "##[command] Set-AzContext -SubscriptionId $($endpointObject.subscriptionID) -TenantId $($endpointObject.tenantId)"
Write-Host "##[command]Set-AzContext -SubscriptionId $($endpointObject.subscriptionID) -TenantId $($endpointObject.tenantId)"
$null = Set-AzContext -SubscriptionId $endpointObject.subscriptionID -TenantId $endpointObject.tenantId
}

Expand Down
4 changes: 2 additions & 2 deletions Tasks/AzurePowerShellV5/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 5,
"Minor": 254,
"Patch": 2
"Minor": 256,
"Patch": 0
},
"releaseNotes": "Added support for Az Module and cross platform agents.",
"groups": [
Expand Down
4 changes: 2 additions & 2 deletions Tasks/AzurePowerShellV5/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"author": "Microsoft Corporation",
"version": {
"Major": 5,
"Minor": 254,
"Patch": 2
"Minor": 256,
"Patch": 0
},
"releaseNotes": "ms-resource:loc.releaseNotes",
"groups": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ function Set-CurrentAzureRMSubscriptionV2 {
$additional = @{ }
if ($TenantId) { $additional['TenantId'] = $TenantId }

Write-Host "##[command] Set-AzureRmContext -SubscriptionId $SubscriptionId $(Format-Splat $additional)"
Write-Host "##[command]Set-AzureRmContext -SubscriptionId $SubscriptionId $(Format-Splat $additional)"
$null = Set-AzureRmContext -SubscriptionId $SubscriptionId @additional
}

Expand Down
6 changes: 3 additions & 3 deletions Tasks/Common/VstsAzureHelpers_/InitializeFunctions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ function Initialize-AzureSubscription {

try {
if (Get-Command -Name "Add-AzureRmAccount" -ErrorAction "SilentlyContinue") {
Write-Host "##[command] Add-AzureRMAccount -Credential $psCredential"
Write-Host "##[command]Add-AzureRMAccount -Credential $psCredential"
$null = Add-AzureRMAccount -Credential $psCredential
} else {
Write-Host "##[command] Connect-AzureRMAccount -Credential $psCredential"
Write-Host "##[command]Connect-AzureRMAccount -Credential $psCredential"
$null = Connect-AzureRMAccount -Credential $psCredential
}
} catch {
Expand All @@ -151,7 +151,7 @@ function Initialize-AzureSubscription {
# Add account (Az).
if ($script:azProfileModule) {
try {
Write-Host "##[command] Connect-AzAccount -Credential $psCredential"
Write-Host "##[command]Connect-AzAccount -Credential $psCredential"
$null = Connect-AzAccount -Credential $psCredential
} catch {
# Provide an additional, custom, credentials-related error message.
Expand Down