Azure / Azure/azure-cli-extensions

azure-devops commands corrupt the powershell console and prevent further output

Open
#2,340 2 comments 0 reactions 0 assignees View on GitHub
customer-reported DevOps Pipelines Service Attention
Dominant language
Python
Stars
454
Forks
1.7k
Avg merge
2d 19h
Merged PRs (30d)
64

Description

### azure-devops

### Description of issue

Running the following command in a powershell window corrupts the console so the output generated is black on black, including the prompt when the command finishes.

$Result = (az pipelines show --organization $ADOUri --project $ADOProjectName --name $PipelineName)

You can work around this issue by creating the following function then calling it after the command is executed:

$PSBackgroundColor = $Host.UI.RawUI.BackgroundColor
$PSForegroundColor = $Host.UI.RawUI.ForegroundColor

function Reset-Console {
$Host.UI.RawUI.BackgroundColor = $PSBackgroundColor
$Host.UI.RawUI.ForegroundColor = $PSForegroundColor
}

The same issue occurs for multiple other commands, and it only seems to happen for commands that output the following message:

This command is in preview. It may be changed/removed in a future release.

![image](https://user-images.githubusercontent.com/6742180/92836833-c1e75100-f3d4-11ea-92a8-94675f7b8671.png)

The x is me entering a character into the now invisible prompt.

Highlighting the text and copying it into a text editor shows the text, so it is rendering as black on black.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.