< Back

New-BTProgressBar

Sun Jan 12, 2020 7:37 pm

NAME New-BTProgressBar



SYNOPSIS

Creates a new Progress Bar Element for Toast Notifications.





SYNTAX

New-BTProgressBar [-Title <String>] -Status <String> -Value <Object> [-ValueDisplay <String>] [-WhatIf] [-Confirm]

[<CommonParameters>]



New-BTProgressBar [-Title <String>] -Status <String> -Indeterminate [-ValueDisplay <String>] [-WhatIf] [-Confirm]

[<CommonParameters>]





DESCRIPTION

The New-BTProgressBar function creates a new Progress Bar Element for Toast Notifications.



You must specify the status and value for the progress bar and can optionally give the bar a title and override

the automatic text representiation of the progress.





PARAMETERS

-Title <String>

The text displayed above the progress bar. Generally used to give context around what the bar represents.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Status <String>

The text displayed under the progress bar. Used to show the current status of the operation being performed.



Examples include: Running, Paused, Stopped, Finished.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Indeterminate [<SwitchParameter>]

Used where the percentage complete is unknown, the resulting progress bar displays a system generated

animation rather than a filled bar.



Cannot be used at the same time as a set Value.



Required? true

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Value <Object>

Specifies the percentage to fill the progress bar as represented by a double, between 0 and 1 (inclusive.)



For example 0.4 is 40%, 1 is 100%.

[ValidateRange(0.0, 1.0)]



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ValueDisplay <String>

A string that replaces the default text representation of the percentage complete.



The default text for the value 0.2 would be '20%', this parameter replaces this text with something of your

own choice.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

String



You cannot pipe input to this cmdlet.





OUTPUTS

Microsoft.Toolkit.Uwp.Notifications.AdaptiveProgressBar





-------------------------- EXAMPLE 1 --------------------------



PS C:\\>New-BTProgressBar -Status 'Copying files' -Value 0.2



This command creates a Progress Bar that is 20% full with the current status of 'Copying files' and the (default)

text 20% displayed underneath.









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>New-BTProgressBar -Status 'Copying files' -Indeterminate



This command creates a Progress Bar with an 'indeterminate' animation rather than a bar filled to a certain

percentage.









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>New-BTProgressBar -Status 'Copying files' -Value 0.2 -ValueDisplay '4/20 files complete'



This command creates a Progress Bar that is 20% full with the current status of 'Copying files' and the default

text displayed underneath overridden to '4/20 files complete.'









-------------------------- EXAMPLE 4 --------------------------



PS C:\\>New-BTProgressBar -Title 'File Copy' -Status 'Copying files' -Value 0.2



This example creates a Progress Bar that is 20% full with the current status of 'Copying files' and the (default)

text 20% displayed underneath.



The Progress Bar is displayed under the title 'File Copy.'









-------------------------- EXAMPLE 5 --------------------------



PS C:\\>$Progress = New-BTProgressBar -Status 'Copying files' -Value 0.2



New-BurntToastNotification -Text 'File copy script running', 'More details!' -ProgressBar $Progress



This example creates a Toast Notification which will include a progress bar.











RELATED LINKS

https://github.com/Windos/BurntToast/bl ... ressBar.md