Skip to content

Integrated Console - Write-Progress messes things up #3423

Closed
@Tiberriver256

Description

@Tiberriver256

Issue Description

Running a script with Write-Progress screws up the console.

Example Script

function MyAwesomeScript {

	[CmdletBinding()]
	param (
		[Parameter()]
		[string]
		$Name
	)

	$WelcomeMessage = @();

	for ($i = 0; $i -lt 50; $i++) {
		Write-Progress -Activity "Getting ready to greet you!" -PercentComplete ($i/50*100)
		$WelcomeMessage += "Hello $Name"
	}

	$WelcomeMessage
}

MyAwesomeScript -Name Micah

Expected Behaviour

Should look like this (example taken from pwsh running in VSCode):

image

Actual Behaviour

Looks like this:

image

The prompt is getting rendered towards the top instead of at the end of the content

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions