Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/DBremen/Write-TerminalProgress
PowerShell function to indicate progress, using cli-spinner icons, during longer running tasks.
https://github.com/DBremen/Write-TerminalProgress
Last synced: about 2 months ago
JSON representation
PowerShell function to indicate progress, using cli-spinner icons, during longer running tasks.
- Host: GitHub
- URL: https://github.com/DBremen/Write-TerminalProgress
- Owner: DBremen
- License: mit
- Created: 2021-03-26T13:35:49.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-03-31T07:04:59.000Z (almost 4 years ago)
- Last Synced: 2024-08-13T07:05:33.066Z (5 months ago)
- Language: PowerShell
- Size: 9.77 KB
- Stars: 12
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - DBremen/Write-TerminalProgress - PowerShell function to indicate progress, using cli-spinner icons, during longer running tasks. (PowerShell)
README
# Write-TerminalProgress
PowerShell terminal spinner progress cmdlet. See related [blog post](https://powershellone.wordpress.com/?p=1506.)
## SYNOPSIS
PowerShell function to indicate progress, using cli-spinner icons, during longer running tasks.## SYNTAX
```
Write-TerminalProgress [-InputObject] [-IconSet] [[-Begin] ]
[-Process] [[-End] ] [[-Activity] ] [[-CurrentStatus] ]
[-ReturnFullOutput]
```## DESCRIPTION
The function utilizes ANSI Escape sequences the build a simple TUI that shows progress using cli-spinners.
The function works similar to foreach-object in many other aspects.## EXAMPLES
### -------------------------- EXAMPLE 1 --------------------------
```
$htArgs = @{
```IconSet = 'fistBump'
Process = { "Doing $_";sleep -Seconds 2 }
Activity = 'Working hard'
CurrentStatus = 'Status _'
}
1..5 | Write-TerminalProgress @htArgs## PARAMETERS
### -InputObject
Specifies the input objects.
The function runs the script block or operation statement on each input object.
The argument to this parameter is usually provided by pipeline.```yaml
Type: Object
Parameter Sets: (All)
Aliases:Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```### -IconSet
The IconSet to be used for the spinner.```yaml
Type: Object
Parameter Sets: (All)
Aliases:Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```### -Begin
Specifies a script block that runs before this cmdlet processes any input objects.```yaml
Type: ScriptBlock
Parameter Sets: (All)
Aliases:Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```### -Process
Specifies the operation that is performed on each input object.
This script block is run for every object in the pipeline.```yaml
Type: ScriptBlock
Parameter Sets: (All)
Aliases:Required: True
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```### -End
Specifies a script block that runs after this cmdlet processes all input objects.
This script block is only run once for the entire pipeline.```yaml
Type: ScriptBlock
Parameter Sets: (All)
Aliases:Required: False
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```### -Activity
A static message that describes the process.```yaml
Type: String
Parameter Sets: (All)
Aliases:Required: False
Position: 6
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```### -CurrentStatus
Progress output for each iteration of the process block.
"_" can be used to refer to the current object.```yaml
Type: String
Parameter Sets: (All)
Aliases:Required: False
Position: 7
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```### -ReturnFullOutput
{{Fill ReturnFullOutput Description}}```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```## INPUTS
## OUTPUTS
## NOTES
## RELATED LINKS
[https://github.com/sindresorhus/cli-spinners](https://github.com/sindresorhus/cli-spinners)
[]()