Allow removing task bar icons

This commit is contained in:
Manuel Thalmann 2024-08-08 02:28:40 +02:00
parent a8929f0707
commit cb3edcfa55
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

@ -65,6 +65,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)) {