Add script for removing pinned icons
This commit is contained in:
parent
73cd34d783
commit
409851f563
2 changed files with 11 additions and 0 deletions
|
@ -28,6 +28,11 @@ class Context {
|
|||
Remove-Item "$env:PUBLIC/Desktop/$pattern";
|
||||
}
|
||||
|
||||
[void] RemoveTaskbarItem($pattern) {
|
||||
Import-Module -UseWindowsPowerShell PinnedItem;
|
||||
Get-PinnedItem -Type TaskBar | Where-Object { $_.Name -like "$pattern" } | Remove-PinnedItem;
|
||||
}
|
||||
|
||||
[Microsoft.Win32.RegistryKey] EnsureConfigKey() {
|
||||
if (-not (Test-Path $this.ConfigRoot)) {
|
||||
$null = New-Item $this.ConfigRoot;
|
||||
|
|
|
@ -7,5 +7,11 @@ foreach ($module in @("PSWindowsUpdate", "KnownFolders"))
|
|||
}
|
||||
}
|
||||
|
||||
foreach ($nativeModule in @("PinnedItem")) {
|
||||
if (-not (powershell -c Get-Module -ListAvailable $nativeModule)) {
|
||||
powershell -c Install-Module -AcceptLicense -Force "$nativeModule";
|
||||
}
|
||||
}
|
||||
|
||||
$Global:InformationPreference = "Continue";
|
||||
$Global:ErrorActionPreference = "Inquire";
|
||||
|
|
Loading…
Reference in a new issue