Skip to content
ConsoleMonster
Cmdlet

Update-ConsoleActivity

Module ConsoleMonster
Inputs
None

Starts, updates or finishes an activity of an activity list (New-ConsoleActivityList) in the running dashboard.

Syntax

Update-ConsoleActivity [[-Activity] <Object>] [-Id] <Int32> [-Name <String>] [-ParentId <Int32>] [-Percent <Double>] [-SecondsRemaining <Double>] [-Session <LiveSession>] [-Status <String>] [<CommonParameters>]
#
Parameter set: Update
Update-ConsoleActivity -Complete [-Id] <Int32> [-Name <String>] [-Session <LiveSession>] [<CommonParameters>]
#
Parameter set: Complete

Description

Starts, updates or finishes an activity of an activity list (New-ConsoleActivityList) in the running dashboard.

-Id identifies the activity: a new id adds a row, an existing one updates it, and -Complete removes it (with the activities under it). -Activity is the title, -Status a short text after it, -Percent the share done (leave it out for work of unknown length, which spins) and -SecondsRemaining an estimate shown as time left. -ParentId indents the activity under another one. The time each activity has taken follows the session clock, so a simulated clock (New-ConsoleClock) drives it too. Safe to call from any runspace or thread.

Examples

Authored help example

EXAMPLE 1

Update-ConsoleActivity -Name running -Id 7 -Activity 'SRV01 · Cert chain'
Update-ConsoleActivity -Name running -Id 7 -Complete

Show a check while it runs, then remove it

EXAMPLE 2

1..4 | ForEach-Object { Update-ConsoleActivity -Name running -Id 9000 -Activity 'Writing fleet.html' -Percent ($_ * 25) }

A report written in steps, with a bar

Parameters

-Activity Object optionalposition: 1sets: Update
The title.
-Id Int32 requiredposition: 0
The activity id (a new id adds a row).
-Name String optional
The activity list name (default $progress).
-ParentId Int32 optionalsets: Update
The id of the activity this one is indented under.
-Percent Double optionalsets: Update
The share done, 0 to 100; leave it out for work of unknown length (it spins).
-SecondsRemaining Double optionalsets: Update
An estimate of the seconds left, shown as time left.
-Session LiveSession optional
The live session to update. Defaults to $ConsoleSession or the running dashboard.
-Status String optionalsets: Update
A short text after the title ("retrying", "3 of 8").
-Complete SwitchParameter requiredsets: Complete
Finishes the activity: its row (and the rows under it) disappear.

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.