New-ConsoleActivityList
Creates an activity list: the work in progress right now, one row per activity, with a spinner or a bar and the time it has taken.
Syntax
New-ConsoleActivityList [-MaxVisible <Int32>] [[-Name] <String>] [-NoElapsed] [-ShowIds] [<CommonParameters>]#All Parameter SetsDescription
Creates an activity list: the work in progress right now, one row per activity, with a spinner or a bar and the time it has taken.
Each activity has an id, a title, an optional status, a percentage (or none, which spins) and an optional parent it is indented under; finished activities disappear, and an empty list takes no space. Update it with Update-ConsoleActivity from the script of a running dashboard or menu run. -MaxVisible caps the rows (more are summed up in one line). The default name, $progress, is also where Write-Progress goes in Start-ConsoleDashboard, so a list with that name shows the script's progress records; give another name for activities of your own.
Examples
EXAMPLE 1
$dashboard = New-ConsoleDashboard -Title 'Checks' { New-ConsolePanel -Title 'Running' { New-ConsoleActivityList -Name running -MaxVisible 4 } }
Start-ConsoleDashboard $dashboard {
Update-ConsoleActivity -Name running -Id 1 -Activity 'SRV01 · Free space'
Start-Sleep -Seconds 1
Update-ConsoleActivity -Name running -Id 1 -Complete
}The checks running on four workers
Parameters
- -MaxVisible Int32
- The most activities shown (default 8); more are summed up in one line.
- -Name String
- The live name used by Update-ConsoleActivity (default $progress, where Write-Progress also goes in Start-ConsoleDashboard).
- -NoElapsed SwitchParameter
- Leaves out the time each activity has taken at the end of its row.
- -ShowIds SwitchParameter
- Starts each row with the activity's id (#3), for parallel work.
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.