# Show the "This PC" icon on Desktop
Function ShowThisPC {
	Write-Output "Showing This PC ..."
	if (-not (Test-Path -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel))
	{
		New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel -Force
	}
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel -Name "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" -PropertyType DWord -Value 0 -Force
}

ShowThisPC

#Do not use item check boxes
Function DisableCheckBoxes {
	Write-Output "Disabling CheckBoxes ..."
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name AutoCheckSelect -PropertyType DWord -Value 0 -Force	
}

DisableCheckBoxes


#Show file name extensions
Function ShowFileExtensions {
	Write-Output "Showing File Extensions ..."
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name HideFileExt -PropertyType DWord -Value 0 -Force		
}

ShowFileExtensions

#Show folder merge conflicts
Function ShowMergeConflicts {
	Write-Output "Showing Merge Conflicts ..."
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name HideMergeConflicts -PropertyType DWord -Value 0 -Force
}

ShowMergeConflicts

#Open File Explorer to "This PC"
Function ThisPCOpenFileExplorerTo {
	Write-Output "This PC Open File Explorer To ..."
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name LaunchTo -PropertyType DWord -Value 1 -Force
}

ThisPCOpenFileExplorerTo

#Hide Cortana button on the taskbar
Function HideCortanaButton {
	Write-Output "Hiding Cortana Button ..."
	if (Get-AppxPackage -Name Microsoft.549981C3F5F10)
	{
		New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowCortanaButton -PropertyType DWord -Value 0 -Force
	}
}

HideCortanaButton

#Do not show sync provider notification within File Explorer
Function HideOneDriveFileExplorerAd {
	Write-Output "Hiding OneDrive File Explorer Ad ..."
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowSyncProviderNotifications -PropertyType DWord -Value 0 -Force
}

HideOneDriveFileExplorerAd

#When I snap a window, do not show what I can snap next to it
Function DisableSnapAssist {
	Write-Output "Disabling Snap Assist ..."
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name SnapAssist -PropertyType DWord -Value 0 -Force		
}

DisableSnapAssist

#Show the file transfer dialog box in the detailed mode
Function DetailedFileTransferDialog {
	Write-Output "Setting Detailed File Transfer Dialog ..."
	if (-not (Test-Path -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager))
	{
		New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager -Force
	}
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager -Name EnthusiastMode -PropertyType DWord -Value 1 -Force	
}

DetailedFileTransferDialog

#Minimize the File Explorer ribbon
Function MinimizedFileExplorerRibbon {
	Write-Output "Setting Minimized File Explorer Ribbon ..."
	if (-not (Test-Path -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Ribbon))
	{
		New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Ribbon -Force
	}
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Ribbon -Name MinimizedStateTabletModeOff -PropertyType DWord -Value 1 -Force
}

MinimizedFileExplorerRibbon

#Hide the "3D Objects" folder in "This PC" and Quick access
Function Hide3DObjects {
	Write-Output "Hiding 3D Objects ..."
	if (-not (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag"))
	{
		New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag" -Force
	}
	New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag" -Name ThisPCPolicy -PropertyType String -Value Hide -Force		
}

Hide3DObjects

#Hide recently used files in Quick access
Function HideQuickAccessRecentFiles {
	Write-Output "Hiding Quick Access Recent Files ..."
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShowRecent -PropertyType DWord -Value 0 -Force
}

HideQuickAccessRecentFiles

#Show the Task View button on the taskbar
Function ShowTaskViewButton {
	Write-Output "Showing Task View Button ..."
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowTaskViewButton -PropertyType DWord -Value 1 -Force
}

ShowTaskViewButton

#Hide People button on the taskbar
Function HidePeopleTaskbar {
	Write-Output "Hiding People Taskbar ..."
	if (-not (Test-Path -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People))
	{
		New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People -Force
	}
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People -Name PeopleBand -PropertyType DWord -Value 0 -Force
}

HidePeopleTaskbar

#Hide the Windows Ink Workspace button on the taskbar
Function HideWindowsInkWorkspace {
	Write-Output "Hiding Windows Ink Workspace ..."
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\PenWorkspace -Name PenWorkspaceButtonDesiredVisibility -PropertyType DWord -Value 0 -Force
}

HideWindowsInkWorkspace

#Hide the Meet Now icon in the notification area
Function HideMeetNow {
	Write-Output "Hiding Meet Now ..."
	$Settings = Get-ItemPropertyValue -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3 -Name Settings -ErrorAction Ignore
	$Settings[9] = 128
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3 -Name Settings -PropertyType Binary -Value $Settings -Force

}

HideMeetNow

#Disable "News and Interests" on the taskbar
Function DisableNewsInterests {
	Write-Output "Disabling News Interest ..."
	New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Feeds -Name ShellFeedsTaskbarViewMode -PropertyType DWord -Value 2 -Force
}

DisableNewsInterests

#Set the default Windows mode to dark
Function DarkWindowsColorMode {
	Write-Output "Setting Dark Windows Color Mode ..."
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name SystemUsesLightTheme -PropertyType DWord -Value 0 -Force
}

DarkWindowsColorMode

#Set the default app mode to dark
Function DarkAppColorMode {
	Write-Output "Setting Dark App Color Mode ..."
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -PropertyType DWord -Value 0 -Force
}

DarkAppColorMode

#Hide the "New App Installed" indicator
Function HideNewAppInstalledNotification {
	Write-Output "Hiding New App Installed Notification ..."
	if (-not (Test-Path -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer))
	{
		New-Item -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Force
	}
	New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Explorer -Name NoNewAppAlert -PropertyType DWord -Value 1 -Force
}

HideNewAppInstalledNotification

#Disable first sign-in animation after the upgrade
Function DisableFirstLogonAnimation {
	Write-Output "Disabling First Logon Animation ..."
	New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name EnableFirstLogonAnimation -PropertyType DWord -Value 0 -Force
}

DisableFirstLogonAnimation

#Set the quality factor of the JPEG desktop wallpapers to maximum
Function MaxJPEGWallpapersQuality {
	Write-Output "Setting Max JPEG Wallpapers Quality ..."
	New-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name JPEGImportQuality -PropertyType DWord -Value 100 -Force
}

MaxJPEGWallpapersQuality


#Notify me when a restart is required to finish updating
Function ShowRestartNotification {
	Write-Output "Showing Restart Notification ..."
	New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings -Name RestartNotificationsAllowed2 -PropertyType DWord -Value 1 -Force
}

ShowRestartNotification

#Do not add the "- Shortcut" suffix to the file name of created shortcuts
Function DisableShortcutsSuffix {
	Write-Output "Disabling Shortcuts Suffix ..."
	if (-not (Test-Path -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\NamingTemplates))
	{
		New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\NamingTemplates -Force
	}
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\NamingTemplates -Name ShortcutNameTemplate -PropertyType String -Value "%s.lnk" -Force
}

DisableShortcutsSuffix

#Do not expand to open folder on navigation pane
Function DisableNavigationPaneExpand {
	Write-Output "Disabling Navigation Pane Expand ..."
	Remove-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name NavPaneExpandToCurrentFolder -Force -ErrorAction Ignore
}

DisableNavigationPaneExpand

#Hide the search on the taskbar
Function HideTaskbarSearch {
	Write-Output "Hiding Taskbar Search ..."
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search -Name SearchboxTaskbarMode -PropertyType DWord -Value 0 -Force
}

HideTaskbarSearch

# Hide app suggestions in the Start menu
Function HideAppSuggestions {
	Write-Output "Hiding App Suggestions ..."
	New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager -Name SubscribedContent-338388Enabled -PropertyType DWord -Value 0 -Force
}

HideAppSuggestions

#Enable highly detailed status messages
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v VerboseStatus /t REG_DWORD /d 1 /f

#Black background
reg add "HKEY_CURRENT_USER\Control Panel\Colors" /v Background /t REG_SZ /d "0 0 0" /f
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v WallPaper /t REG_SZ /d " " /f

#Set the accent color
$accentColor = "#5b5b5b"  # Replace with your desired color in RGB format
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Accent" -Name "AccentColorMenu" -Value $accentColor

#Hide Widgets  [Windows 11]
# Create the "Dsh" key under HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Dsh"

# Add the DWORD value "AllowNewsAndInterests" with a value of 0 to the "Dsh" key
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Dsh" -Name "AllowNewsAndInterests" -Value 0 -PropertyType DWORD

#Hide Chat icon  [Windows 11]
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarMn" -Value 0 -PropertyType DWORD

#Align start menu to the left [Windows 11]
New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarAl" -Value 0 -PropertyType DWORD

#Get Windows 10 context menu [Windows 11]
reg add "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" /ve /t REG_SZ /d "" /f

#Apply the changes immediately (might require explorer.exe to restart)
RUNDLL32.EXE user32.dll, UpdatePerUserSystemParameters