diff --git a/scripts/Windows/Scripts/Context.ps1 b/scripts/Windows/Scripts/Context.ps1 index d9c7ad23..afbcbeb6 100644 --- a/scripts/Windows/Scripts/Context.ps1 +++ b/scripts/Windows/Scripts/Context.ps1 @@ -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; diff --git a/scripts/Windows/Scripts/Prerequisites.ps1 b/scripts/Windows/Scripts/Prerequisites.ps1 index d82b032a..c7047894 100644 --- a/scripts/Windows/Scripts/Prerequisites.ps1 +++ b/scripts/Windows/Scripts/Prerequisites.ps1 @@ -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";