mirror of
https://github.com/ChrisTitusTech/winutil
synced 2026-06-09 15:57:27 +00:00
01ef78915a
* Made -NoUi not exit the window * Update start.ps1 * Update main.ps1 * Update main.ps1 * Update Set-WinUtilProgressbar.ps1 * Update Invoke-WPFImpex.ps1 * Update Invoke-WPFUIThread.ps1 * Update start.ps1 * Update Invoke-WPFUIThread.ps1 * Update main.ps1 * Update main.ps1
25 lines
859 B
PowerShell
25 lines
859 B
PowerShell
function Set-WinUtilProgressbar{
|
|
<#
|
|
.SYNOPSIS
|
|
This function is used to Update the Progress Bar displayed in the winutil GUI.
|
|
It will be automatically hidden if the user clicks something and no process is running
|
|
.PARAMETER Label
|
|
The Text to be overlaid onto the Progress Bar
|
|
.PARAMETER PERCENT
|
|
The percentage of the Progress Bar that should be filled (0-100)
|
|
#>
|
|
param(
|
|
[string]$Label,
|
|
[ValidateRange(0,100)]
|
|
[int]$Percent
|
|
)
|
|
|
|
Invoke-WPFUIThread -ScriptBlock {$sync.progressBarTextBlock.Text = $label}
|
|
Invoke-WPFUIThread -ScriptBlock {$sync.progressBarTextBlock.ToolTip = $label}
|
|
if ($percent -lt 5 ) {
|
|
$percent = 5 # Ensure the progress bar is not empty, as it looks weird
|
|
}
|
|
Invoke-WPFUIThread -ScriptBlock { $sync.ProgressBar.Value = $percent}
|
|
|
|
}
|