Gallery seems to be a bit of a moving target. Try this final script:
$keys = @(
"HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel",
"HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu"
)
$clsids = @(
"{24AD3AD4-A569-4530-98E1-AB02F9417AA8}", # Gallery (new Photos hub)
"{E88865EA-0E1C-4E20-9AA6-EDCD0212C87C}", # Gallery alternate (File Explorer)
"{3ADD1653-EB32-4CB0-BBD7-DFA0ABB5ACCA}", # Pictures legacy
"{B155BDF8-02F0-451E-9A26-4197FDAD9EA6}", # Shell Gallery variant (Win11 test builds)
"{E25B5812-BE88-4BD9-94B0-29233477B6E6}" # Photos "Collection" (some Insider builds)
)
foreach ($key in $keys) {
foreach ($clsid in $clsids) {
New-ItemProperty -Path $key -Name $clsid -Value 1 -PropertyType DWORD -Force | Out-Null
}
}
Stop-Process -Name explorer -Force
Start-Process explorer