File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Tasks/Common/VstsAzureHelpers_ Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -652,6 +652,10 @@ function Disconnect-AzureAndClearContext {
652652 Write-Host " ##[command]Logout-AzureRmAccount"
653653 Logout- AzureRmAccount
654654 }
655+ else {
656+ $noCommandMessage = " Unable to find a command to log out of Azure"
657+ Write-Host " ##vso[task.logissue type=warning;]$noCommandMessage "
658+ }
655659
656660 if (Get-Command - Name " Clear-AzureRmContext" - ErrorAction " SilentlyContinue" ) {
657661 Write-Host " ##[command]Clear-AzureRmContext -Scope Process"
@@ -660,6 +664,8 @@ function Disconnect-AzureAndClearContext {
660664 $null = Clear-AzureRmContext - Scope CurrentUser - Force - ErrorAction SilentlyContinue
661665 }
662666 } catch {
663- Write-Verbose " Unable to disconnect and clear context: $_ .Exception.Message"
667+ $error = $_.Exception.Message
668+ Write-Verbose " Unable to disconnect and clear context: $error "
669+ Write-Host " ##vso[task.logissue type=warning;]$error "
664670 }
665671}
You can’t perform that action at this time.
0 commit comments