Added Task View Tweak (#2141)

Co-authored-by: hubster-bot <hubsterbotbuisness@gmail.com>
Co-authored-by: Chris Titus <contact@christitus.com>
This commit is contained in:
Real-MullaC 2024-06-28 16:14:05 +01:00 committed by GitHub
parent b268f98b91
commit 9086b30a75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 52 additions and 0 deletions

View File

@ -3114,5 +3114,13 @@
"panel": "2",
"Order": "a082_",
"Type": "300"
},
"WPFToggleTaskView": {
"Content": "Task View",
"Description": "If Enabled then Task View Icon in Taskbar will be shown.",
"category": "Customize Preferences",
"panel": "2",
"Order": "a069_",
"Type": "Toggle"
}
}

View File

@ -116,6 +116,15 @@ Function Get-WinUtilToggleStatus {
return $true
}
}
if ($ToggleSwitch -eq "WPFToggleTaskView") {
$TaskView = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced').ShowTaskViewButton
if($TaskView -eq 0){
return $false
}
else{
return $true
}
}
if ($ToggleSwitch -eq "WPFToggleTaskbarWidgets") {
$TaskbarWidgets = (Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced").TaskBarDa
if($TaskbarWidgets -eq 0) {

View File

@ -0,0 +1,34 @@
function Invoke-WinUtilTaskView {
<#
.SYNOPSIS
Enable/Disable Task View
.PARAMETER Enabled
Indicates whether to enable or disable Task View
#>
Param($Enabled)
Try{
if ($Enabled -eq $false){
Write-Host "Enabling Task View"
$value = 1
}
else {
Write-Host "Disabling Task View"
$value = 0
}
$Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
Set-ItemProperty -Path $Path -Name ShowTaskViewButton -Value $value
}
Catch [System.Security.SecurityException] {
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception"
}
Catch [System.Management.Automation.ItemNotFoundException] {
Write-Warning $psitem.Exception.ErrorRecord
}
Catch{
Write-Warning "Unable to set $Name due to unhandled exception"
Write-Warning $psitem.Exception.StackTrace
}
}

View File

@ -29,5 +29,6 @@ function Invoke-WPFToggle {
"WPFToggleStickyKeys" {Invoke-WinUtilStickyKeys $(Get-WinUtilToggleStatus WPFToggleStickyKeys)}
"WPFToggleTaskbarWidgets" {Invoke-WinUtilTaskbarWidgets $(Get-WinUtilToggleStatus WPFToggleTaskbarWidgets)}
"WPFToggleTaskbarSearch" {Invoke-WinUtilTaskbarSearch $(Get-WinUtilToggleStatus WPFToggleTaskbarSearch)}
"WPFToggleTaskView" {Invoke-WinUtilTaskView $(Get-WinUtilToggleStatus WPFToggleTaskView)}
}
}