mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-07-03 03:23:31 -05:00
add function to manage taskbar item
changed from manually setting the taskbar overlay, progressvalue and progress state to setting them through a function
This commit is contained in:
@ -13,20 +13,20 @@ function Install-WinUtilChoco {
|
||||
if((Test-WinUtilPackageManager -choco) -eq "installed") {
|
||||
return
|
||||
}
|
||||
|
||||
$sync["Form"].taskbarItemInfo.ProgressState = "Indeterminate"
|
||||
|
||||
Set-WinUtilTaskbaritem -state "Indeterminate"
|
||||
|
||||
Write-Host "Seems Chocolatey is not installed, installing now."
|
||||
Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) -ErrorAction Stop
|
||||
powershell choco feature enable -n allowGlobalConfirmation
|
||||
$sync["Form"].taskbarItemInfo.ProgressState = "None"
|
||||
Set-WinUtilTaskbaritem -state "None"
|
||||
|
||||
}
|
||||
Catch {
|
||||
Write-Host "===========================================" -Foregroundcolor Red
|
||||
Write-Host "-- Chocolatey failed to install ---" -Foregroundcolor Red
|
||||
Write-Host "===========================================" -Foregroundcolor Red
|
||||
$sync["Form"].taskbarItemInfo.ProgressState = "Error"
|
||||
Set-WinUtilTaskbaritem -state "Error"
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user