function Get-ControlPanelView{[CmdletBinding()]param()Write-Verbose "$(Get-TimeStamp): Getting Control Panel View icon status.";$AllItemsIconView = (Get-ItemProperty -Path "HKCU:SoftwareMicrosoftWindowsCurrentVersionExplorerControlPanel" -Name AllItemsIconView).AllItemsIconView$StartupPage = (Get-ItemProperty -Path "HKCU:SoftwareMicrosoftWindowsCurrentVersionExplorerControlPanel" -Name StartupPage).StartupPage# $AllItemsIconView = 0/$StartupPage = 1 : Large Iconsif(($AllItemsIconView -eq 0) -and ($StartupPage -eq 1)){Write-Verbose "$(Get-TimeStamp): Control Panel View set to `"Large Icons`"."
class="MsoNormal"> return Large Icons;
}
# $AllItemsIconView = 1/$StartupPage = 0 : Category
if(($AllItemsIconView -eq 1) -and ($StartupPage -eq 0))
{
Write-Verbose "$(Get-TimeStamp): Control Panel View set to `"Category`"."
return Category;
}
# $AllItemsIconView = 1/$StartupPage = 1 : Small Icons
if(($AllItemsIconView -eq 1) -and ($StartupPage -eq 1))
{
Write-Verbose "$(Get-TimeStamp): Control Panel View set to `"Small Icons`"."
return Small Icons;
}
}
When I run this, it is a simple command which can use -Verbose to get more details.