Allow removing task bar icons

This commit is contained in:
Manuel Thalmann 2024-08-08 02:28:40 +02:00
parent 95922559c2
commit 4613f82442
2 changed files with 17 additions and 0 deletions

View file

@ -29,3 +29,19 @@ function Remove-DesktopIcon {
} }
} }
} }
<#
.SYNOPSIS
Removes icons from the task bar.
.PARAMETER Pattern
The pattern of the icon names to remove.
#>
function Remove-TaskbarItem {
param(
[string] $Pattern
)
Import-Module -UseWindowsPowerShell PinnedItem;
Get-PinnedItem -Type TaskBar | Where-Object { $_.Name -like "$Pattern" } | ForEach-Object { Remove-PinnedItem $_ };
}

View file

@ -64,6 +64,7 @@ $null = New-Module {
Invoke-Hook "Install-PSModules" -Fallback { Invoke-Hook "Install-PSModules" -Fallback {
Install-Module -AcceptLicense -Force PSWindowsUpdate; Install-Module -AcceptLicense -Force PSWindowsUpdate;
Install-Module -AcceptLicense -Force PSScriptAnalyzer; Install-Module -AcceptLicense -Force PSScriptAnalyzer;
. "$PSScriptRoot/../../Common/Software/PinnedItem/Manage.ps1";
}; };
if (-not (Test-Winget)) { if (-not (Test-Winget)) {