Update-ConsoleActivity
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>]#UpdateUpdate-ConsoleActivity -Complete [-Id] <Int32> [-Name <String>] [-Session <LiveSession>] [<CommonParameters>]#CompleteDescription
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
EXAMPLE 1
Update-ConsoleActivity -Name running -Id 7 -Activity 'SRV01 · Cert chain'
Update-ConsoleActivity -Name running -Id 7 -CompleteShow 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
- The title.
- -Id Int32
- The activity id (a new id adds a row).
- -Name String
- The activity list name (default $progress).
- -ParentId Int32
- The id of the activity this one is indented under.
- -Percent Double
- The share done, 0 to 100; leave it out for work of unknown length (it spins).
- -SecondsRemaining Double
- An estimate of the seconds left, shown as time left.
- -Session LiveSession
- The live session to update. Defaults to $ConsoleSession or the running dashboard.
- -Status String
- A short text after the title ("retrying", "3 of 8").
- -Complete SwitchParameter
- 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.