Skip to content
ConsoleMonster
Cmdlet

Write-ConsoleProgress

Module ConsoleMonster
Inputs
None

Writes a progress update, drawn by ConsoleMonster when Enable-ConsoleFormatting -Feature Progress is on.

Syntax

Write-ConsoleProgress [[-Activity] <String>] [-Completed] [-CurrentOperation <String>] [[-Id] <Int32>] [-ParentId <Int32>] [-PercentComplete <Int32>] [-SecondsRemaining <Int32>] [-SourceId <Int32>] [[-Status] <String>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

Writes a progress update, drawn by ConsoleMonster when Enable-ConsoleFormatting -Feature Progress is on.

Takes the same parameters as Write-Progress. With Enable-ConsoleFormatting -Feature Progress, Write-Progress is an alias of this command for the session, so scripts and functions that call Write-Progress get ConsoleMonster's progress area: one row per activity below the cursor (nested with -ParentId), with a bar, the percentage, the status and the elapsed time. Output and errors written in between appear above the area, warnings and Write-Host lines too, and the area disappears when every activity completes or the command ends. $ProgressPreference and -ProgressAction are honoured. Without the feature, in redirected output, jobs, remoting and other hosts, it writes PowerShell's own progress record. Progress written by compiled cmdlets (Copy-Item, Invoke-WebRequest) is still shown by PowerShell.

Examples

Authored help example

EXAMPLE 1

foreach ($i in 1..50) { Write-Progress -Activity 'Copying' -Status "File $i of 50" -PercentComplete ($i * 2); Start-Sleep -Milliseconds 50 }

An existing loop, after Enable-ConsoleFormatting -Feature Progress

Parameters

-Activity String optionalposition: 0
The activity (the row's title).
-Completed SwitchParameter optional
The activity is done: its row (and its children) disappear.
-CurrentOperation String optional
The current operation, shown after the status.
-Id Int32 optionalposition: 2
The activity's id; different ids are separate rows.
-ParentId Int32 optional
The parent activity's id: the row is nested under it.
-PercentComplete Int32 optional
The percentage done (0-100), or -1 when it is not known.
-SecondsRemaining Int32 optional
The seconds left, or -1 when it is not known.
-SourceId Int32 optional
Accepted for compatibility with Write-Progress and ignored.
-Status String optionalposition: 1
The status shown after the bar.

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.