⚡ PowerShell 5.1+

Check "Show This PC Icon on Desktop" Status

Reads the current registry value behind the "Show This PC Icon on Desktop" tweak so you can confirm whether it's applied.

By WindowsScripting.com · 962 B
Test-ShowThisPCOnDesktopStatus.ps1
<#
.SYNOPSIS
    Checks whether "Show This PC Icon on Desktop" is currently applied.

.DESCRIPTION
    Reads HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel \ {20D04FE0-3AEA-1069-A2D8-08002B30309D} and reports its current value,
    or reports that it isn't set (falling back to the Windows default).

.EXAMPLE
    .\Test-ShowThisPCOnDesktopStatus.ps1
#>

[CmdletBinding()]
param()

$regPath = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel'

$value = Get-ItemProperty -Path $regPath -Name '{20D04FE0-3AEA-1069-A2D8-08002B30309D}' -ErrorAction SilentlyContinue

if ($null -eq $value) {
    Write-Host "'{20D04FE0-3AEA-1069-A2D8-08002B30309D}' is not set at $regPath (using the Windows default)." -ForegroundColor Yellow
} else {
    Write-Host "Current value of '{20D04FE0-3AEA-1069-A2D8-08002B30309D}': $($value.'{20D04FE0-3AEA-1069-A2D8-08002B30309D}')" -ForegroundColor Green
}