When I run this, it is a simple command which can use -Verbose to get more details.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`"."return Large Icons;}# $AllItemsIconView = 1/$StartupPage = 0 : Categoryif(($AllItemsIconView -eq 1) -and ($StartupPage -eq 0)){Write-Verbose "$(Get-TimeStamp): Control Panel View set to `"Category`"."return Category;}# $AllItemsIconView = 1/$StartupPage = 1 : Small Iconsif(($AllItemsIconView -eq 1) -and ($StartupPage -eq 1)){Write-Verbose "$(Get-TimeStamp): Control Panel View set to `"Small Icons`"."return Small Icons;}}
Saturday, December 24, 2016
PowerShell v3 Function Get ControlPanelView
Posted by
karjana
,
at
2:24 PM
Subscribe to:
Post Comments (Atom)