From 488baa111f074429b414f302b49bc748169ed021 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Sat, 14 Apr 2018 12:23:32 +0200 Subject: [PATCH] Update "UnpinStartMenuTiles" for 1803, closes #71 (thx @sippi90) --- Win10.ps1 | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/Win10.ps1 b/Win10.ps1 index 14f1d5a..7fa82fa 100644 --- a/Win10.ps1 +++ b/Win10.ps1 @@ -2304,21 +2304,27 @@ Function DisableAudio { # Unpinning ########## -# Unpin all Start Menu tiles - Not applicable to Server - Note: This function has no counterpart. You have to pin the tiles back manually. +# Unpin all Start Menu tiles - Note: This function has no counterpart. You have to pin the tiles back manually. Function UnpinStartMenuTiles { Write-Output "Unpinning all Start Menu tiles..." - Get-ChildItem -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache\DefaultAccount" -Include "*.group" -Recurse | ForEach-Object { - $data = (Get-ItemProperty -Path "$($_.PsPath)\Current" -Name "Data").Data -Join "," - $data = $data.Substring(0, $data.IndexOf(",0,202,30") + 9) + ",0,202,80,0,0" - Set-ItemProperty -Path "$($_.PsPath)\Current" -Name "Data" -Type Binary -Value $data.Split(",") + If ([System.Environment]::OSVersion.Version.Build -eq 16299) { + Get-ChildItem -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache\DefaultAccount" -Include "*.group" -Recurse | ForEach-Object { + $data = (Get-ItemProperty -Path "$($_.PsPath)\Current" -Name "Data").Data -Join "," + $data = $data.Substring(0, $data.IndexOf(",0,202,30") + 9) + ",0,202,80,0,0" + Set-ItemProperty -Path "$($_.PsPath)\Current" -Name "Data" -Type Binary -Value $data.Split(",") + } + } ElseIf ([System.Environment]::OSVersion.Version.Build -eq 17133) { + $key = Get-ChildItem -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache\DefaultAccount" -Recurse | Where-Object { $_ -like "*start.tilegrid`$windows.data.curatedtilecollection.tilecollection\Current" } + $data = (Get-ItemProperty -Path $key.PSPath -Name "Data").Data[0..25] + ([byte[]](202,50,0,226,44,1,1,0,0)) + Set-ItemProperty -Path $key.PSPath -Name "Data" -Type Binary -Value $data } } # Unpin all Taskbar icons - Note: This function has no counterpart. You have to pin the icons back manually. Function UnpinTaskbarIcons { Write-Output "Unpinning all Taskbar icons..." - Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband" -Name "Favorites" -Type Binary -Value ([byte[]](255)) - Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband" -Name "FavoritesResolve" -ErrorAction SilentlyContinue + Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Taskband" -Name "Favorites" -Type Binary -Value ([byte[]](255)) + Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Taskband" -Name "FavoritesResolve" -ErrorAction SilentlyContinue }