We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3208277 commit 2d321eaCopy full SHA for 2d321ea
Modules/Scripts/Set-PinTaskbar.ps1
@@ -10,6 +10,7 @@ If true then unpin target from the Taskbar
10
11
.NOTES
12
https://community.spiceworks.com/topic/2165665-pinning-taskbar-items-with-powershell-script
13
+https://github.com/gunnarhaslinger/Add-or-Remove-Application-To-Windows-10-Taskbar/blob/master/TaskbarPinning.ps1
14
#>
15
16
param(
@@ -44,8 +45,12 @@ Begin
44
45
{
46
Write-Verbose '... unregistering shell handler verb'
47
$shellKey.DeleteSubKeyTree('{:}', $false)
- $shellKey.Close()
48
- $shellKey.Dispose()
+ if ($shellKey.SubKeyCount -eq 0 -and $shellKey.ValueCount -eq 0)
49
+ {
50
+ (Get-Item 'HKCU:\SOFTWARE\Classes'
51
+ ).OpenSubKey('*', $true
52
+ ).DeleteSubKey("shell")
53
+ }
54
Write-Verbose '... shell handler verb unregistered'
55
}
56
0 commit comments