{"uuid": "74b2e489-2074-4ac1-a3df-90723c65cef8", "vulnerability_lookup_origin": "1a89b78e-f703-45f3-bb86-59eb712668bd", "author": "9f56dd64-161d-43a6-b9c3-555944290a09", "vulnerability": "CVE-2017-5754", "type": "seen", "source": "https://gist.github.com/lexi-the-cute/49026ceee125849a5824f71ba3b9125e", "content": "### \n###\n### UPDATE: For Win 11, I recommend using this tool in place of this script: \n### https://christitus.com/windows-tool/\n### https://github.com/ChrisTitusTech/winutil\n### https://www.youtube.com/watch?v=6UQZ5oQg8XA\n### iwr -useb https://christitus.com/win | iex\n###\n### OR take a look at \n### https://github.com/HotCakeX/Harden-Windows-Security\n\n\n##########\n# Tweaked Win10 Initial Setup Script\n# Primary Author: Disassembler \n# Modified by: alirobe  based on my personal preferences.\n# Version: 2.20.2, 2018-09-14\n# Primary Author Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script\n# Tweaked Source: https://gist.github.com/alirobe/7f3b34ad89a159e6daa1/\n# Tweak difference:\n#\n#    @alirobe's version is a subset focused on safely disabling telemetry, some 'smart' features and 3rd party bloat ...\n#    ... while retaining win10 defaults + security features. Aim to be suitable for end-user rollout.\n#\n#    If you're a power user looking to tweak your machinea, or doing larger roll-out.. \n#    Use the @Disassembler0 script instead. It'll probably be more up-to-date than mine:\n#    https://github.com/Disassembler0/Win10-Initial-Setup-Script\n# \n#    Note from author: Never run scripts without reading them &amp; understanding what they do.\n#\n##########\n# Default preset\n$tweaks = @(\n\t### Require administrator privileges ###\n\t\"RequireAdmin\",\n\n\t### Privacy Tweaks ###\n\t\"DisableTelemetry\",             # \"EnableTelemetry\",\n\t\"DisableWiFiSense\",             # \"EnableWiFiSense\",\n\t\"DisableSmartScreen\",         # \"EnableSmartScreen\",\n\t\"DisableWebSearch\",             # \"EnableWebSearch\",\n\t\"DisableAppSuggestions\",        # \"EnableAppSuggestions\",\n\t\"DisableActivityHistory\",       # \"EnableActivityHistory\",\n\t#\"DisableBackgroundApps\",        # \"EnableBackgroundApps\",\n\t\"DisableLocationTracking\",      # \"EnableLocationTracking\",\n\t\"DisableMapUpdates\",            # \"EnableMapUpdates\",\n\t\"DisableFeedback\",              # \"EnableFeedback\",\n\t\"DisableTailoredExperiences\",   # \"EnableTailoredExperiences\",\n\t\"DisableAdvertisingID\",         # \"EnableAdvertisingID\",\n\t\"DisableCortana\",               # \"EnableCortana\",\n\t\"DisableErrorReporting\",        # \"EnableErrorReporting\",\n\t\"SetP2PUpdateLocal\",          # \"SetP2PUpdateInternet\",\n\t\"DisableDiagTrack\",             # \"EnableDiagTrack\",\n\t\"DisableWAPPush\",               # \"EnableWAPPush\",\n\n\t### Security Tweaks ###\n\t# \"SetUACLow\",                  # \"SetUACHigh\",\n\t# \"EnableSharingMappedDrives\",  # \"DisableSharingMappedDrives\",\n\t# \"DisableAdminShares\",           # \"EnableAdminShares\",\n\t\"DisableSMB1\",                # \"EnableSMB1\",\n\t# \"DisableSMBServer\",           # \"EnableSMBServer\",\n\t# \"DisableLLMNR\",               # \"EnableLLMNR\",\n\t\"SetCurrentNetworkPrivate\",     # \"SetCurrentNetworkPublic\",\n\t# \"SetUnknownNetworksPrivate\",  # \"SetUnknownNetworksPublic\",\n\t# \"DisableNetDevicesAutoInst\",  # \"EnableNetDevicesAutoInst\",\n\t# \"EnableCtrldFolderAccess\",    # \"DisableCtrldFolderAccess\",\n\t# \"DisableFirewall\",            # \"EnableFirewall\",\n\t# \"DisableDefender\",            # \"EnableDefender\",\n\t# \"DisableDefenderCloud\",       # \"EnableDefenderCloud\",\n\t\"EnableF8BootMenu\",             # \"DisableF8BootMenu\",\n\t#\"SetDEPOptOut\",                 # \"SetDEPOptIn\",\n\t# \"EnableCIMemoryIntegrity\",    # \"DisableCIMemoryIntegrity\",\n\t#\"DisableScriptHost\",            # \"EnableScriptHost\",\n\t#\"EnableDotNetStrongCrypto\",     # \"DisableDotNetStrongCrypto\",\n\t# \"EnableMeltdownCompatFlag\"    # \"DisableMeltdownCompatFlag\",\n\n\t### Service Tweaks ###\n\t# \"DisableUpdateMSRT\",          # \"EnableUpdateMSRT\",\n\t# \"DisableUpdateDriver\",        # \"EnableUpdateDriver\",\n\t\"DisableUpdateRestart\",         # \"EnableUpdateRestart\",\n\t\"DisableHomeGroups\",          # \"EnableHomeGroups\",\n\t# \"DisableSharedExperiences\",     # \"EnableSharedExperiences\",\n\t# \"DisableRemoteAssistance\",      # \"EnableRemoteAssistance\",\n\t# \"EnableRemoteDesktop\",          # \"DisableRemoteDesktop\",\n\t\"DisableAutoplay\",              # \"EnableAutoplay\",\n\t\"DisableAutorun\",               # \"EnableAutorun\",\n\t# \"EnableStorageSense\",         # \"DisableStorageSense\",\n\t# \"DisableDefragmentation\",     # \"EnableDefragmentation\",\n\t# \"DisableSuperfetch\",          # \"EnableSuperfetch\",\n\t# \"DisableIndexing\",            # \"EnableIndexing\",\n\t# \"SetBIOSTimeUTC\",             # \"SetBIOSTimeLocal\",\n\t# \"EnableHibernation\",          # \"DisableHibernation\",\n\t# \"DisableSleepButton\",         # \"EnableSleepButton\",\n\t# \"DisableSleepTimeout\",        # \"EnableSleepTimeout\",\n\t# \"DisableFastStartup\",         # \"EnableFastStartup\",\n\n\t### UI Tweaks ###\n\t# \"DisableActionCenter\",          # \"EnableActionCenter\",\n\t# \"DisableLockScreen\",            # \"EnableLockScreen\",\n\t# \"DisableLockScreenRS1\",       # \"EnableLockScreenRS1\",\n\t# \"HideNetworkFromLockScreen\",    # \"ShowNetworkOnLockScreen\",\n\t# \"HideShutdownFromLockScreen\",   # \"ShowShutdownOnLockScreen\",\n\t# \"DisableStickyKeys\",            # \"EnableStickyKeys\",\n\t\"ShowTaskManagerDetails\"        # \"HideTaskManagerDetails\",\n\t\"ShowFileOperationsDetails\",    # \"HideFileOperationsDetails\",\n\t# \"EnableFileDeleteConfirm\",    # \"DisableFileDeleteConfirm\",\n\t#\"HideTaskbarSearch\",\n\t\"ShowTaskbarSearchIcon\",      # \"ShowTaskbarSearchBox\",\n\t# \"HideTaskView\",                 # \"ShowTaskView\",\n\t# \"ShowSmallTaskbarIcons\",        # \"ShowLargeTaskbarIcons\",\n\t# \"SetTaskbarCombineWhenFull\",    # \"SetTaskbarCombineNever\",     # \"SetTaskbarCombineAlways\",\n\t# \"HideTaskbarPeopleIcon\",        # \"ShowTaskbarPeopleIcon\",\n\t# \"ShowTrayIcons\",                # \"HideTrayIcons\",\n\t# \"DisableSearchAppInStore\",      # \"EnableSearchAppInStore\",\n\t# \"DisableNewAppPrompt\",          # \"EnableNewAppPrompt\",\n\t# \"SetControlPanelSmallIcons\",  # \"SetControlPanelLargeIcons\",  # \"SetControlPanelCategories\",\n\t# \"SetVisualFXPerformance\",       # \"SetVisualFXAppearance\",\n\t# \"AddENKeyboard\",              # \"RemoveENKeyboard\",\n\t# \"EnableNumlock\",              # \"DisableNumlock\",\n\n\t### Explorer UI Tweaks ###\n\t\"ShowKnownExtensions\",          # \"HideKnownExtensions\",\n\t# \"ShowHiddenFiles\",              # \"HideHiddenFiles\",\n\t# \"HideSyncNotifications\"         # \"ShowSyncNotifications\",\n\t# \"HideRecentShortcuts\",          # \"ShowRecentShortcuts\",\n\t\"SetExplorerThisPC\",            # \"SetExplorerQuickAccess\",\n\t\"ShowThisPCOnDesktop\",          # \"HideThisPCFromDesktop\",\n\t# \"ShowUserFolderOnDesktop\",    # \"HideUserFolderFromDesktop\",\n\t# \"HideDesktopFromThisPC\",        # \"ShowDesktopInThisPC\",\n\t# \"HideDesktopFromExplorer\",    # \"ShowDesktopInExplorer\",\n\t# \"HideDocumentsFromThisPC\",      # \"ShowDocumentsInThisPC\",\n\t# \"HideDocumentsFromExplorer\",  # \"ShowDocumentsInExplorer\",\n\t# \"HideDownloadsFromThisPC\",      # \"ShowDownloadsInThisPC\",\n\t# \"HideDownloadsFromExplorer\",  # \"ShowDownloadsInExplorer\",\n\t# \"HideMusicFromThisPC\",          # \"ShowMusicInThisPC\",\n\t# \"HideMusicFromExplorer\",      # \"ShowMusicInExplorer\",\n\t# \"HidePicturesFromThisPC\",       # \"ShowPicturesInThisPC\",\n\t# \"HidePicturesFromExplorer\",   # \"ShowPicturesInExplorer\",\n\t# \"HideVideosFromThisPC\",         # \"ShowVideosInThisPC\",\n\t# \"HideVideosFromExplorer\",     # \"ShowVideosInExplorer\",\n\t\"Hide3DObjectsFromThisPC\",      # \"Show3DObjectsInThisPC\",\n\t# \"Hide3DObjectsFromExplorer\",  # \"Show3DObjectsInExplorer\",\n\t# \"DisableThumbnails\",          # \"EnableThumbnails\",\n\t# \"DisableThumbsDB\",              # \"EnableThumbsDB\",\n\n\t### Application Tweaks ###\n\t# \"DisableOneDrive\",              # \"EnableOneDrive\",\n\t# \"UninstallOneDrive\",            # \"InstallOneDrive\",\n\t# \"UninstallMsftBloat\",           # \"InstallMsftBloat\",\n\t\"UninstallThirdPartyBloat\",     # \"InstallThirdPartyBloat\",\n\t# \"UninstallWindowsStore\",      # \"InstallWindowsStore\",\n\t# \"DisableXboxFeatures\",          # \"EnableXboxFeatures\",\n\t# \"DisableAdobeFlash\",            # \"EnableAdobeFlash\",\n\t# \"UninstallMediaPlayer\",       # \"InstallMediaPlayer\",\n\t# \"UninstallInternetExplorer\",  # \"InstallInternetExplorer\",\n\t# \"UninstallWorkFolders\",       # \"InstallWorkFolders\",\n\t# \"InstallLinuxSubsystem\",      # \"UninstallLinuxSubsystem\",\n\t# \"InstallHyperV\",              # \"UninstallHyperV\",\n\t\"SetPhotoViewerAssociation\",    # \"UnsetPhotoViewerAssociation\",\n\t\"AddPhotoViewerOpenWith\",       # \"RemovePhotoViewerOpenWith\",\n\t# \"UninstallPDFPrinter\",        # \"InstallPDFPrinter\",\n\t# \"UninstallXPSPrinter\",          # \"InstallXPSPrinter\",\n\t# \"RemoveFaxPrinter\",             # \"AddFaxPrinter\",\n\n\t### Server Specific Tweaks ###\n\t# \"HideServerManagerOnLogin\",   # \"ShowServerManagerOnLogin\",\n\t# \"DisableShutdownTracker\",     # \"EnableShutdownTracker\",\n\t# \"DisablePasswordPolicy\",      # \"EnablePasswordPolicy\",\n\t# \"DisableCtrlAltDelLogin\",     # \"EnableCtrlAltDelLogin\",\n\t# \"DisableIEEnhancedSecurity\",  # \"EnableIEEnhancedSecurity\",\n\t# \"EnableAudio\",                # \"DisableAudio\",\n\n\t### Unpinning ###\n\t\"UnpinStartMenuTiles\",\n\t#\"UnpinTaskbarIcons\",\n\n\t### Auxiliary Functions ###\n\t\"WaitForKey\"\n\t\"Restart\"\n)\n\n\n\n##########\n# Privacy Tweaks\n##########\n\n# Disable Telemetry\n# Note: This tweak may cause Enterprise edition to stop receiving Windows updates.\n# Windows Update control panel will then show message \"Your device is at risk because it's out of date and missing important security and quality updates. Let's get you back on track so Windows can run more securely. Select this button to get going\".\n# In such case, enable telemetry, run Windows update and then disable telemetry again. See also https://github.com/Disassembler0/Win10-Initial-Setup-Script/issues/57\nFunction DisableTelemetry {\n\tWrite-Output \"Disabling Telemetry...\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\DataCollection\" -Name \"AllowTelemetry\" -Type DWord -Value 0\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Policies\\DataCollection\" -Name \"AllowTelemetry\" -Type DWord -Value 0\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\DataCollection\" -Name \"AllowTelemetry\" -Type DWord -Value 0\n\tDisable-ScheduledTask -TaskName \"Microsoft\\Windows\\Application Experience\\Microsoft Compatibility Appraiser\" | Out-Null\n\tDisable-ScheduledTask -TaskName \"Microsoft\\Windows\\Application Experience\\ProgramDataUpdater\" | Out-Null\n\tDisable-ScheduledTask -TaskName \"Microsoft\\Windows\\Autochk\\Proxy\" | Out-Null\n\tDisable-ScheduledTask -TaskName \"Microsoft\\Windows\\Customer Experience Improvement Program\\Consolidator\" | Out-Null\n\tDisable-ScheduledTask -TaskName \"Microsoft\\Windows\\Customer Experience Improvement Program\\UsbCeip\" | Out-Null\n\tDisable-ScheduledTask -TaskName \"Microsoft\\Windows\\DiskDiagnostic\\Microsoft-Windows-DiskDiagnosticDataCollector\" | Out-Null\n}\n\n# Enable Telemetry\nFunction EnableTelemetry {\n\tWrite-Output \"Enabling Telemetry...\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\DataCollection\" -Name \"AllowTelemetry\" -Type DWord -Value 3\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Policies\\DataCollection\" -Name \"AllowTelemetry\" -Type DWord -Value 3\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\DataCollection\" -Name \"AllowTelemetry\" -ErrorAction SilentlyContinue\n\tEnable-ScheduledTask -TaskName \"Microsoft\\Windows\\Application Experience\\Microsoft Compatibility Appraiser\" | Out-Null\n\tEnable-ScheduledTask -TaskName \"Microsoft\\Windows\\Application Experience\\ProgramDataUpdater\" | Out-Null\n\tEnable-ScheduledTask -TaskName \"Microsoft\\Windows\\Autochk\\Proxy\" | Out-Null\n\tEnable-ScheduledTask -TaskName \"Microsoft\\Windows\\Customer Experience Improvement Program\\Consolidator\" | Out-Null\n\tEnable-ScheduledTask -TaskName \"Microsoft\\Windows\\Customer Experience Improvement Program\\UsbCeip\" | Out-Null\n\tEnable-ScheduledTask -TaskName \"Microsoft\\Windows\\DiskDiagnostic\\Microsoft-Windows-DiskDiagnosticDataCollector\" | Out-Null\n}\n\n# Disable Wi-Fi Sense\nFunction DisableWiFiSense {\n\tWrite-Output \"Disabling Wi-Fi Sense...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Microsoft\\PolicyManager\\default\\WiFi\\AllowWiFiHotSpotReporting\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\PolicyManager\\default\\WiFi\\AllowWiFiHotSpotReporting\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\PolicyManager\\default\\WiFi\\AllowWiFiHotSpotReporting\" -Name \"Value\" -Type DWord -Value 0\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\PolicyManager\\default\\WiFi\\AllowAutoConnectToWiFiSenseHotspots\" -Name \"Value\" -Type DWord -Value 0\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Microsoft\\WcmSvc\\wifinetworkmanager\\config\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\WcmSvc\\wifinetworkmanager\\config\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\WcmSvc\\wifinetworkmanager\\config\" -Name \"AutoConnectAllowedOEM\" -Type Dword -Value 0\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\WcmSvc\\wifinetworkmanager\\config\" -Name \"WiFISenseAllowed\" -Type Dword -Value 0\n}\n\n# Enable Wi-Fi Sense\nFunction EnableWiFiSense {\n\tWrite-Output \"Enabling Wi-Fi Sense...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Microsoft\\PolicyManager\\default\\WiFi\\AllowWiFiHotSpotReporting\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\PolicyManager\\default\\WiFi\\AllowWiFiHotSpotReporting\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\PolicyManager\\default\\WiFi\\AllowWiFiHotSpotReporting\" -Name \"Value\" -Type DWord -Value 1\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\PolicyManager\\default\\WiFi\\AllowAutoConnectToWiFiSenseHotspots\" -Name \"Value\" -Type DWord -Value 1\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\WcmSvc\\wifinetworkmanager\\config\" -Name \"AutoConnectAllowedOEM\" -ErrorAction SilentlyContinue\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\WcmSvc\\wifinetworkmanager\\config\" -Name \"WiFISenseAllowed\" -ErrorAction SilentlyContinue\n}\n\n# Disable SmartScreen Filter\nFunction DisableSmartScreen {\n\tWrite-Output \"Disabling SmartScreen Filter...\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\" -Name \"EnableSmartScreen\" -Type DWord -Value 0\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\MicrosoftEdge\\PhishingFilter\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\MicrosoftEdge\\PhishingFilter\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\MicrosoftEdge\\PhishingFilter\" -Name \"EnabledV9\" -Type DWord -Value 0\n}\n\n# Enable SmartScreen Filter\nFunction EnableSmartScreen {\n\tWrite-Output \"Enabling SmartScreen Filter...\"\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\" -Name \"EnableSmartScreen\" -ErrorAction SilentlyContinue\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\MicrosoftEdge\\PhishingFilter\" -Name \"EnabledV9\" -ErrorAction SilentlyContinue\n}\n\n# Disable Web Search in Start Menu\nFunction DisableWebSearch {\n\tWrite-Output \"Disabling Bing Search in Start Menu...\"\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Search\" -Name \"BingSearchEnabled\" -Type DWord -Value 0\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Search\" -Name \"CortanaConsent\" -Type DWord -Value 0\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Windows Search\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Windows Search\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Windows Search\" -Name \"DisableWebSearch\" -Type DWord -Value 1\n}\n\n# Enable Web Search in Start Menu\nFunction EnableWebSearch {\n\tWrite-Output \"Enabling Bing Search in Start Menu...\"\n\tRemove-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Search\" -Name \"BingSearchEnabled\" -ErrorAction SilentlyContinue\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Search\" -Name \"CortanaConsent\" -Type DWord -Value 1\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Windows Search\" -Name \"DisableWebSearch\" -ErrorAction SilentlyContinue\n}\n\n# Disable Application suggestions and automatic installation\nFunction DisableAppSuggestions {\n\tWrite-Output \"Disabling Application suggestions...\"\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager\" -Name \"ContentDeliveryAllowed\" -Type DWord -Value 0\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager\" -Name \"OemPreInstalledAppsEnabled\" -Type DWord -Value 0\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager\" -Name \"PreInstalledAppsEnabled\" -Type DWord -Value 0\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager\" -Name \"PreInstalledAppsEverEnabled\" -Type DWord -Value 0\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager\" -Name \"SilentInstalledAppsEnabled\" -Type DWord -Value 0\n\tSet-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager\" -Name \"SubscribedContent-338387Enabled\" -Type DWord -Value 0\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager\" -Name \"SubscribedContent-338388Enabled\" -Type DWord -Value 0\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager\" -Name \"SubscribedContent-338389Enabled\" -Type DWord -Value 0\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager\" -Name \"SubscribedContent-353698Enabled\" -Type DWord -Value 0\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager\" -Name \"SystemPaneSuggestionsEnabled\" -Type DWord -Value 0\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\CloudContent\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\CloudContent\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\CloudContent\" -Name \"DisableWindowsConsumerFeatures\" -Type DWord -Value 1\n}\n\n# Enable Application suggestions and automatic installation\nFunction EnableAppSuggestions {\n\tWrite-Output \"Enabling Application suggestions...\"\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager\" -Name \"ContentDeliveryAllowed\" -Type DWord -Value 1\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager\" -Name \"OemPreInstalledAppsEnabled\" -Type DWord -Value 1\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager\" -Name \"PreInstalledAppsEnabled\" -Type DWord -Value 1\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager\" -Name \"PreInstalledAppsEverEnabled\" -Type DWord -Value 1\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager\" -Name \"SilentInstalledAppsEnabled\" -Type DWord -Value 1\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager\" -Name \"SubscribedContent-338388Enabled\" -Type DWord -Value 1\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager\" -Name \"SubscribedContent-338389Enabled\" -Type DWord -Value 1\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager\" -Name \"SystemPaneSuggestionsEnabled\" -Type DWord -Value 1\n\tRemove-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager\" -Name \"SubscribedContent-338387Enabled\" -ErrorAction SilentlyContinue\n\tRemove-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ContentDeliveryManager\" -Name \"SubscribedContent-353698Enabled\" -ErrorAction SilentlyContinue\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\CloudContent\" -Name \"DisableWindowsConsumerFeatures\" -ErrorAction SilentlyContinue\n}\n\n# Disable Activity History feed in Task View - Note: The checkbox \"Let Windows collect my activities from this PC\" remains checked even when the function is disabled\nFunction DisableActivityHistory {\n\tWrite-Output \"Disabling Activity History...\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\" -Name \"EnableActivityFeed\" -Type DWord -Value 0\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\" -Name \"PublishUserActivities\" -Type DWord -Value 0\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\" -Name \"UploadUserActivities\" -Type DWord -Value 0\n}\n\n# Enable Activity History feed in Task View\nFunction EnableActivityHistory {\n\tWrite-Output \"Enabling Activity History...\"\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\" -Name \"EnableActivityFeed\" -ErrorAction SilentlyContinue\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\" -Name \"PublishUserActivities\" -ErrorAction SilentlyContinue\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\" -Name \"UploadUserActivities\" -ErrorAction SilentlyContinue\n}\n\n# Disable Background application access - ie. if apps can download or update when they aren't used - Cortana is excluded as its inclusion breaks start menu search\nFunction DisableBackgroundApps {\n\tWrite-Output \"Disabling Background application access...\"\n\tGet-ChildItem -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\BackgroundAccessApplications\" -Exclude \"Microsoft.Windows.Cortana*\" | ForEach {\n\t\tSet-ItemProperty -Path $_.PsPath -Name \"Disabled\" -Type DWord -Value 1\n\t\tSet-ItemProperty -Path $_.PsPath -Name \"DisabledByUser\" -Type DWord -Value 1\n\t}\n}\n\n# Enable Background application access\nFunction EnableBackgroundApps {\n\tWrite-Output \"Enabling Background application access...\"\n\tGet-ChildItem -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\BackgroundAccessApplications\" | ForEach {\n\t\tRemove-ItemProperty -Path $_.PsPath -Name \"Disabled\" -ErrorAction SilentlyContinue\n\t\tRemove-ItemProperty -Path $_.PsPath -Name \"DisabledByUser\" -ErrorAction SilentlyContinue\n\t}\n}\n\n# Disable Location Tracking\nFunction DisableLocationTracking {\n\tWrite-Output \"Disabling Location Tracking...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\CapabilityAccessManager\\ConsentStore\\location\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\CapabilityAccessManager\\ConsentStore\\location\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\CapabilityAccessManager\\ConsentStore\\location\" -Name \"Value\" -Type String -Value \"Deny\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Sensor\\Overrides\\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}\" -Name \"SensorPermissionState\" -Type DWord -Value 0\n\tSet-ItemProperty -Path \"HKLM:\\SYSTEM\\CurrentControlSet\\Services\\lfsvc\\Service\\Configuration\" -Name \"Status\" -Type DWord -Value 0\n}\n\n# Enable Location Tracking\nFunction EnableLocationTracking {\n\tWrite-Output \"Enabling Location Tracking...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\CapabilityAccessManager\\ConsentStore\\location\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\CapabilityAccessManager\\ConsentStore\\location\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\CapabilityAccessManager\\ConsentStore\\location\" -Name \"Value\" -Type String -Value \"Allow\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Sensor\\Overrides\\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}\" -Name \"SensorPermissionState\" -Type DWord -Value 1\n\tSet-ItemProperty -Path \"HKLM:\\SYSTEM\\CurrentControlSet\\Services\\lfsvc\\Service\\Configuration\" -Name \"Status\" -Type DWord -Value 1\n}\n\n# Disable automatic Maps updates\nFunction DisableMapUpdates {\n\tWrite-Output \"Disabling automatic Maps updates...\"\n\tSet-ItemProperty -Path \"HKLM:\\SYSTEM\\Maps\" -Name \"AutoUpdateEnabled\" -Type DWord -Value 0\n}\n\n# Enable automatic Maps updates\nFunction EnableMapUpdates {\n\tWrite-Output \"Enable automatic Maps updates...\"\n\tRemove-ItemProperty -Path \"HKLM:\\SYSTEM\\Maps\" -Name \"AutoUpdateEnabled\" -ErrorAction SilentlyContinue\n}\n\n# Disable Feedback\nFunction DisableFeedback {\n\tWrite-Output \"Disabling Feedback...\"\n\tIf (!(Test-Path \"HKCU:\\SOFTWARE\\Microsoft\\Siuf\\Rules\")) {\n\t\tNew-Item -Path \"HKCU:\\SOFTWARE\\Microsoft\\Siuf\\Rules\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Siuf\\Rules\" -Name \"NumberOfSIUFInPeriod\" -Type DWord -Value 0\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\DataCollection\" -Name \"DoNotShowFeedbackNotifications\" -Type DWord -Value 1\n\tDisable-ScheduledTask -TaskName \"Microsoft\\Windows\\Feedback\\Siuf\\DmClient\" -ErrorAction SilentlyContinue | Out-Null\n\tDisable-ScheduledTask -TaskName \"Microsoft\\Windows\\Feedback\\Siuf\\DmClientOnScenarioDownload\" -ErrorAction SilentlyContinue | Out-Null\n}\n\n# Enable Feedback\nFunction EnableFeedback {\n\tWrite-Output \"Enabling Feedback...\"\n\tRemove-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Siuf\\Rules\" -Name \"NumberOfSIUFInPeriod\" -ErrorAction SilentlyContinue\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\DataCollection\" -Name \"DoNotShowFeedbackNotifications\" -ErrorAction SilentlyContinue\n\tEnable-ScheduledTask -TaskName \"Microsoft\\Windows\\Feedback\\Siuf\\DmClient\" -ErrorAction SilentlyContinue | Out-Null\n\tEnable-ScheduledTask -TaskName \"Microsoft\\Windows\\Feedback\\Siuf\\DmClientOnScenarioDownload\" -ErrorAction SilentlyContinue | Out-Null\n}\n\n# Disable Tailored Experiences\nFunction DisableTailoredExperiences {\n\tWrite-Output \"Disabling Tailored Experiences...\"\n\tIf (!(Test-Path \"HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\CloudContent\")) {\n\t\tNew-Item -Path \"HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\CloudContent\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\CloudContent\" -Name \"DisableTailoredExperiencesWithDiagnosticData\" -Type DWord -Value 1\n}\n\n# Enable Tailored Experiences\nFunction EnableTailoredExperiences {\n\tWrite-Output \"Enabling Tailored Experiences...\"\n\tRemove-ItemProperty -Path \"HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\CloudContent\" -Name \"DisableTailoredExperiencesWithDiagnosticData\" -ErrorAction SilentlyContinue\n}\n\n# Disable Advertising ID\nFunction DisableAdvertisingID {\n\tWrite-Output \"Disabling Advertising ID...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\AdvertisingInfo\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\AdvertisingInfo\" | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\AdvertisingInfo\" -Name \"DisabledByGroupPolicy\" -Type DWord -Value 1\n}\n\n# Enable Advertising ID\nFunction EnableAdvertisingID {\n\tWrite-Output \"Enabling Advertising ID...\"\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\AdvertisingInfo\" -Name \"DisabledByGroupPolicy\" -ErrorAction SilentlyContinue\n}\n\n# Disable Cortana\nFunction DisableCortana {\n\tWrite-Output \"Disabling Cortana...\"\n\tIf (!(Test-Path \"HKCU:\\SOFTWARE\\Microsoft\\Personalization\\Settings\")) {\n\t\tNew-Item -Path \"HKCU:\\SOFTWARE\\Microsoft\\Personalization\\Settings\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Personalization\\Settings\" -Name \"AcceptedPrivacyPolicy\" -Type DWord -Value 0\n\tIf (!(Test-Path \"HKCU:\\SOFTWARE\\Microsoft\\InputPersonalization\")) {\n\t\tNew-Item -Path \"HKCU:\\SOFTWARE\\Microsoft\\InputPersonalization\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\InputPersonalization\" -Name \"RestrictImplicitTextCollection\" -Type DWord -Value 1\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\InputPersonalization\" -Name \"RestrictImplicitInkCollection\" -Type DWord -Value 1\n\tIf (!(Test-Path \"HKCU:\\SOFTWARE\\Microsoft\\InputPersonalization\\TrainedDataStore\")) {\n\t\tNew-Item -Path \"HKCU:\\SOFTWARE\\Microsoft\\InputPersonalization\\TrainedDataStore\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\InputPersonalization\\TrainedDataStore\" -Name \"HarvestContacts\" -Type DWord -Value 0\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Windows Search\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Windows Search\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Windows Search\" -Name \"AllowCortana\" -Type DWord -Value 0\n}\n\n# Enable Cortana\nFunction EnableCortana {\n\tWrite-Output \"Enabling Cortana...\"\n\tRemove-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Personalization\\Settings\" -Name \"AcceptedPrivacyPolicy\" -ErrorAction SilentlyContinue\n\tIf (!(Test-Path \"HKCU:\\SOFTWARE\\Microsoft\\InputPersonalization\\TrainedDataStore\")) {\n\t\tNew-Item -Path \"HKCU:\\SOFTWARE\\Microsoft\\InputPersonalization\\TrainedDataStore\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\InputPersonalization\" -Name \"RestrictImplicitTextCollection\" -Type DWord -Value 0\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\InputPersonalization\" -Name \"RestrictImplicitInkCollection\" -Type DWord -Value 0\n\tRemove-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\InputPersonalization\\TrainedDataStore\" -Name \"HarvestContacts\" -ErrorAction SilentlyContinue\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Windows Search\" -Name \"AllowCortana\" -ErrorAction SilentlyContinue\n}\n\n# Disable Error reporting\nFunction DisableErrorReporting {\n\tWrite-Output \"Disabling Error reporting...\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\Windows Error Reporting\" -Name \"Disabled\" -Type DWord -Value 1\n\tDisable-ScheduledTask -TaskName \"Microsoft\\Windows\\Windows Error Reporting\\QueueReporting\" | Out-Null\n}\n\n# Enable Error reporting\nFunction EnableErrorReporting {\n\tWrite-Output \"Enabling Error reporting...\"\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\Windows Error Reporting\" -Name \"Disabled\" -ErrorAction SilentlyContinue\n\tEnable-ScheduledTask -TaskName \"Microsoft\\Windows\\Windows Error Reporting\\QueueReporting\" | Out-Null\n}\n\n# Restrict Windows Update P2P only to local network - Needed only for 1507 as local P2P is the default since 1511\nFunction SetP2PUpdateLocal {\n\tWrite-Output \"Restricting Windows Update P2P only to local network...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\DeliveryOptimization\\Config\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\DeliveryOptimization\\Config\" | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\DeliveryOptimization\\Config\" -Name \"DODownloadMode\" -Type DWord -Value 1\n}\n\n# Unrestrict Windows Update P2P\nFunction SetP2PUpdateInternet {\n\tWrite-Output \"Unrestricting Windows Update P2P to internet...\"\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\DeliveryOptimization\\Config\" -Name \"DODownloadMode\" -ErrorAction SilentlyContinue\n}\n\n# Stop and disable Diagnostics Tracking Service\nFunction DisableDiagTrack {\n\tWrite-Output \"Stopping and disabling Diagnostics Tracking Service...\"\n\tStop-Service \"DiagTrack\" -WarningAction SilentlyContinue\n\tSet-Service \"DiagTrack\" -StartupType Disabled\n}\n\n# Enable and start Diagnostics Tracking Service\nFunction EnableDiagTrack {\n\tWrite-Output \"Enabling and starting Diagnostics Tracking Service...\"\n\tSet-Service \"DiagTrack\" -StartupType Automatic\n\tStart-Service \"DiagTrack\" -WarningAction SilentlyContinue\n}\n\n# Stop and disable WAP Push Service\nFunction DisableWAPPush {\n\tWrite-Output \"Stopping and disabling WAP Push Service...\"\n\tStop-Service \"dmwappushservice\" -WarningAction SilentlyContinue\n\tSet-Service \"dmwappushservice\" -StartupType Disabled\n}\n\n# Enable and start WAP Push Service\nFunction EnableWAPPush {\n\tWrite-Output \"Enabling and starting WAP Push Service...\"\n\tSet-Service \"dmwappushservice\" -StartupType Automatic\n\tStart-Service \"dmwappushservice\" -WarningAction SilentlyContinue\n\tSet-ItemProperty -Path \"HKLM:\\SYSTEM\\CurrentControlSet\\Services\\dmwappushservice\" -Name \"DelayedAutoStart\" -Type DWord -Value 1\n}\n\n\n\n##########\n# Security Tweaks\n##########\n\n# Lower UAC level (disabling it completely would break apps)\nFunction SetUACLow {\n\tWrite-Output \"Lowering UAC level...\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\" -Name \"ConsentPromptBehaviorAdmin\" -Type DWord -Value 0\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\" -Name \"PromptOnSecureDesktop\" -Type DWord -Value 0\n}\n\n# Raise UAC level\nFunction SetUACHigh {\n\tWrite-Output \"Raising UAC level...\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\" -Name \"ConsentPromptBehaviorAdmin\" -Type DWord -Value 5\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\" -Name \"PromptOnSecureDesktop\" -Type DWord -Value 1\n}\n\n# Enable sharing mapped drives between users\nFunction EnableSharingMappedDrives {\n\tWrite-Output \"Enabling sharing mapped drives between users...\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\" -Name \"EnableLinkedConnections\" -Type DWord -Value 1\n}\n\n# Disable sharing mapped drives between users\nFunction DisableSharingMappedDrives {\n\tWrite-Output \"Disabling sharing mapped drives between users...\"\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\" -Name \"EnableLinkedConnections\" -ErrorAction SilentlyContinue\n}\n\n# Disable implicit administrative shares\nFunction DisableAdminShares {\n\tWrite-Output \"Disabling implicit administrative shares...\"\n\tSet-ItemProperty -Path \"HKLM:\\SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Parameters\" -Name \"AutoShareWks\" -Type DWord -Value 0\n}\n\n# Enable implicit administrative shares\nFunction EnableAdminShares {\n\tWrite-Output \"Enabling implicit administrative shares...\"\n\tRemove-ItemProperty -Path \"HKLM:\\SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Parameters\" -Name \"AutoShareWks\" -ErrorAction SilentlyContinue\n}\n\n# Disable obsolete SMB 1.0 protocol - Disabled by default since 1709\nFunction DisableSMB1 {\n\tWrite-Output \"Disabling SMB 1.0 protocol...\"\n\tSet-SmbServerConfiguration -EnableSMB1Protocol $false -Force\n}\n\n# Enable obsolete SMB 1.0 protocol - Disabled by default since 1709\nFunction EnableSMB1 {\n\tWrite-Output \"Enabling SMB 1.0 protocol...\"\n\tSet-SmbServerConfiguration -EnableSMB1Protocol $true -Force\n}\n\n# Disable SMB Server - Completely disables file and printer sharing, but leaves the system able to connect to another SMB server as a client\nFunction DisableSMBServer {\n\tWrite-Output \"Disabling SMB Server...\"\n\tSet-SmbServerConfiguration -EnableSMB1Protocol $false -Force\n\tSet-SmbServerConfiguration -EnableSMB2Protocol $false -Force\n}\n\n# Enable SMB Server\nFunction EnableSMBServer {\n\tWrite-Output \"Enabling SMB Server...\"\n\tSet-SmbServerConfiguration -EnableSMB2Protocol $true -Force\n}\n\n# Disable Link-Local Multicast Name Resolution (LLMNR) protocol\nFunction DisableLLMNR {\n\tWrite-Output \"Disabling LLMNR...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows NT\\DNSClient\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows NT\\DNSClient\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows NT\\DNSClient\" -Name \"EnableMulticast\" -Type DWord -Value 0\n}\n\n# Enable Link-Local Multicast Name Resolution (LLMNR) protocol\nFunction EnableLLMNR {\n\tWrite-Output \"Enabling LLMNR...\"\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows NT\\DNSClient\" -Name \"EnableMulticast\" -ErrorAction SilentlyContinue\n}\n\n# Set current network profile to private (allow file sharing, device discovery, etc.)\nFunction SetCurrentNetworkPrivate {\n\tWrite-Output \"Setting current network profile to private...\"\n\tSet-NetConnectionProfile -NetworkCategory Private\n}\n\n# Set current network profile to public (deny file sharing, device discovery, etc.)\nFunction SetCurrentNetworkPublic {\n\tWrite-Output \"Setting current network profile to public...\"\n\tSet-NetConnectionProfile -NetworkCategory Public\n}\n\n# Set unknown networks profile to private (allow file sharing, device discovery, etc.)\nFunction SetUnknownNetworksPrivate {\n\tWrite-Output \"Setting unknown networks profile to private...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows NT\\CurrentVersion\\NetworkList\\Signatures\\010103000F0000F0010000000F0000F0C967A3643C3AD745950DA7859209176EF5B87C875FA20DF21951640E807D7C24\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows NT\\CurrentVersion\\NetworkList\\Signatures\\010103000F0000F0010000000F0000F0C967A3643C3AD745950DA7859209176EF5B87C875FA20DF21951640E807D7C24\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows NT\\CurrentVersion\\NetworkList\\Signatures\\010103000F0000F0010000000F0000F0C967A3643C3AD745950DA7859209176EF5B87C875FA20DF21951640E807D7C24\" -Name \"Category\" -Type DWord -Value 1\n}\n\n# Set unknown networks profile to public (deny file sharing, device discovery, etc.)\nFunction SetUnknownNetworksPublic {\n\tWrite-Output \"Setting unknown networks profile to public...\"\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows NT\\CurrentVersion\\NetworkList\\Signatures\\010103000F0000F0010000000F0000F0C967A3643C3AD745950DA7859209176EF5B87C875FA20DF21951640E807D7C24\" -Name \"Category\" -ErrorAction SilentlyContinue\n}\n\n# Disable automatic installation of network devices\nFunction DisableNetDevicesAutoInst {\n\tWrite-Output \"Disabling automatic installation of network devices...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\NcdAutoSetup\\Private\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\NcdAutoSetup\\Private\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\NcdAutoSetup\\Private\" -Name \"AutoSetup\" -Type DWord -Value 0\n}\n\n# Enable automatic installation of network devices\nFunction EnableNetDevicesAutoInst {\n\tWrite-Output \"Enabling automatic installation of network devices...\"\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\NcdAutoSetup\\Private\" -Name \"AutoSetup\" -ErrorAction SilentlyContinue\n}\n\n# Enable Controlled Folder Access (Defender Exploit Guard feature) - Applicable to 1709 or newer, requires Windows Defender to be enabled\nFunction EnableCtrldFolderAccess {\n\tWrite-Output \"Enabling Controlled Folder Access...\"\n\tSet-MpPreference -EnableControlledFolderAccess Enabled\n}\n\n# Disable Controlled Folder Access (Defender Exploit Guard feature) - Applicable to 1709 or newer, requires Windows Defender to be enabled\nFunction DisableCtrldFolderAccess {\n\tWrite-Output \"Disabling Controlled Folder Access...\"\n\tSet-MpPreference -EnableControlledFolderAccess Disabled\n}\n\n# Disable Firewall\nFunction DisableFirewall {\n\tWrite-Output \"Disabling Firewall...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\WindowsFirewall\\StandardProfile\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\WindowsFirewall\\StandardProfile\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\WindowsFirewall\\StandardProfile\" -Name \"EnableFirewall\" -Type DWord -Value 0\n}\n\n# Enable Firewall\nFunction EnableFirewall {\n\tWrite-Output \"Enabling Firewall...\"\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\WindowsFirewall\\StandardProfile\" -Name \"EnableFirewall\" -ErrorAction SilentlyContinue\n}\n\n# Disable Windows Defender\nFunction DisableDefender {\n\tWrite-Output \"Disabling Windows Defender...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\" -Name \"DisableAntiSpyware\" -Type DWord -Value 1\n\tIf ([System.Environment]::OSVersion.Version.Build -eq 14393) {\n\t\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\" -Name \"WindowsDefender\" -ErrorAction SilentlyContinue\n\t} ElseIf ([System.Environment]::OSVersion.Version.Build -ge 15063) {\n\t\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\" -Name \"SecurityHealth\" -ErrorAction SilentlyContinue\n\t}\n}\n\n# Enable Windows Defender\nFunction EnableDefender {\n\tWrite-Output \"Enabling Windows Defender...\"\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\" -Name \"DisableAntiSpyware\" -ErrorAction SilentlyContinue\n\tIf ([System.Environment]::OSVersion.Version.Build -eq 14393) {\n\t\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\" -Name \"WindowsDefender\" -Type ExpandString -Value \"`\"%ProgramFiles%\\Windows Defender\\MSASCuiL.exe`\"\"\n\t} ElseIf ([System.Environment]::OSVersion.Version.Build -ge 15063) {\n\t\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\" -Name \"SecurityHealth\" -Type ExpandString -Value \"`\"%ProgramFiles%\\Windows Defender\\MSASCuiL.exe`\"\"\n\t}\n}\n\n# Disable Windows Defender Cloud\nFunction DisableDefenderCloud {\n\tWrite-Output \"Disabling Windows Defender Cloud...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Spynet\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Spynet\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Spynet\" -Name \"SpynetReporting\" -Type DWord -Value 0\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Spynet\" -Name \"SubmitSamplesConsent\" -Type DWord -Value 2\n}\n\n# Enable Windows Defender Cloud\nFunction EnableDefenderCloud {\n\tWrite-Output \"Enabling Windows Defender Cloud...\"\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Spynet\" -Name \"SpynetReporting\" -ErrorAction SilentlyContinue\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Spynet\" -Name \"SubmitSamplesConsent\" -ErrorAction SilentlyContinue\n}\n\n# Enable F8 boot menu options\nFunction EnableF8BootMenu {\n\tWrite-Output \"Enabling F8 boot menu options...\"\n\tbcdedit /set `{current`} bootmenupolicy Legacy | Out-Null\n}\n\n# Disable F8 boot menu options\nFunction DisableF8BootMenu {\n\tWrite-Output \"Disabling F8 boot menu options...\"\n\tbcdedit /set `{current`} bootmenupolicy Standard | Out-Null\n}\n\n# Set Data Execution Prevention (DEP) policy to OptOut\nFunction SetDEPOptOut {\n\tWrite-Output \"Setting Data Execution Prevention (DEP) policy to OptOut...\"\n\tbcdedit /set `{current`} nx OptOut | Out-Null\n}\n\n# Set Data Execution Prevention (DEP) policy to OptIn\nFunction SetDEPOptIn {\n\tWrite-Output \"Setting Data Execution Prevention (DEP) policy to OptIn...\"\n\tbcdedit /set `{current`} nx OptIn | Out-Null\n}\n\n# Enable Core Isolation Memory Integrity - Part of Windows Defender System Guard virtualization-based security - Supported from 1803\nFunction EnableCIMemoryIntegrity {\n\tWrite-Output \"Enabling Core Isolation Memory Integrity...\"\n\tIf (!(Test-Path \"HKLM:\\SYSTEM\\CurrentControlSet\\Control\\DeviceGuard\\Scenarios\\HypervisorEnforcedCodeIntegrity\")) {\n\t\tNew-Item -Path \"HKLM:\\SYSTEM\\CurrentControlSet\\Control\\DeviceGuard\\Scenarios\\HypervisorEnforcedCodeIntegrity\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SYSTEM\\CurrentControlSet\\Control\\DeviceGuard\\Scenarios\\HypervisorEnforcedCodeIntegrity\" -Name \"Enabled\" -Type DWord -Value 1\n}\n\n# Disable Core Isolation Memory Integrity - \nFunction DisableCIMemoryIntegrity {\n\tWrite-Output \"Disabling Core Isolation Memory Integrity...\"\n\tRemove-ItemProperty -Path \"HKLM:\\SYSTEM\\CurrentControlSet\\Control\\DeviceGuard\\Scenarios\\HypervisorEnforcedCodeIntegrity\" -Name \"Enabled\" -ErrorAction SilentlyContinue\n}\n\n# Disable Windows Script Host (execution of *.vbs scripts and alike)\nFunction DisableScriptHost {\n\tWrite-Output \"Disabling Windows Script Host...\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows Script Host\\Settings\" -Name \"Enabled\" -Type DWord -Value 0\n}\n\n# Enable Windows Script Host\nFunction EnableScriptHost {\n\tWrite-Output \"Enabling Windows Script Host...\"\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows Script Host\\Settings\" -Name \"Enabled\" -ErrorAction SilentlyContinue\n}\n\n# Enable strong cryptography for .NET Framework (version 4 and above)\n# https://stackoverflow.com/questions/36265534/invoke-webrequest-ssl-fails\nFunction EnableDotNetStrongCrypto {\n\tWrite-output \"Enabling .NET strong cryptography...\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\.NETFramework\\v4.0.30319\" -Name \"SchUseStrongCrypto\" -Type DWord -Value 1\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\.NETFramework\\v4.0.30319\" -Name \"SchUseStrongCrypto\" -Type DWord -Value 1\n}\n\n# Disable strong cryptography for .NET Framework (version 4 and above)\nFunction DisableDotNetStrongCrypto {\n\tWrite-output \"Disabling .NET strong cryptography...\"\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\.NETFramework\\v4.0.30319\" -Name \"SchUseStrongCrypto\" -ErrorAction SilentlyContinue\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\.NETFramework\\v4.0.30319\" -Name \"SchUseStrongCrypto\" -ErrorAction SilentlyContinue\n}\n\n# Enable Meltdown (CVE-2017-5754) compatibility flag - Required for January 2018 and all subsequent Windows updates\n# This flag is normally automatically enabled by compatible antivirus software (such as Windows Defender).\n# Use the tweak only if you have confirmed that your AV is compatible but unable to set the flag automatically or if you don't use any AV at all.\n# See https://support.microsoft.com/en-us/help/4072699/january-3-2018-windows-security-updates-and-antivirus-software for details.\nFunction EnableMeltdownCompatFlag {\n\tWrite-Output \"Enabling Meltdown (CVE-2017-5754) compatibility flag...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\QualityCompat\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\QualityCompat\" | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\QualityCompat\" -Name \"cadca5fe-87d3-4b96-b7fb-a231484277cc\" -Type DWord -Value 0\n}\n\n# Disable Meltdown (CVE-2017-5754) compatibility flag\nFunction DisableMeltdownCompatFlag {\n\tWrite-Output \"Disabling Meltdown (CVE-2017-5754) compatibility flag...\"\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\QualityCompat\" -Name \"cadca5fe-87d3-4b96-b7fb-a231484277cc\" -ErrorAction SilentlyContinue\n}\n\n\n\n##########\n# Service Tweaks\n##########\n\n# Disable offering of Malicious Software Removal Tool through Windows Update\nFunction DisableUpdateMSRT {\n\tWrite-Output \"Disabling Malicious Software Removal Tool offering...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\MRT\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\MRT\" | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\MRT\" -Name \"DontOfferThroughWUAU\" -Type DWord -Value 1\n}\n\n# Enable offering of Malicious Software Removal Tool through Windows Update\nFunction EnableUpdateMSRT {\n\tWrite-Output \"Enabling Malicious Software Removal Tool offering...\"\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\MRT\" -Name \"DontOfferThroughWUAU\" -ErrorAction SilentlyContinue\n}\n\n# Disable offering of drivers through Windows Update\n# Note: This doesn't work properly if you use a driver intended for another hardware model. E.g. Intel I219-V on WinServer works only with I219-LM driver.\n# Therefore Windows update will repeatedly try and fail to install I219-V driver indefinitely even if you use the tweak.\nFunction DisableUpdateDriver {\n\tWrite-Output \"Disabling driver offering through Windows Update...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Device Metadata\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Device Metadata\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Device Metadata\" -Name \"PreventDeviceMetadataFromNetwork\" -Type DWord -Value 1\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\DriverSearching\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\DriverSearching\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\DriverSearching\" -Name \"DontPromptForWindowsUpdate\" -Type DWord -Value 1\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\DriverSearching\" -Name \"DontSearchWindowsUpdate\" -Type DWord -Value 1\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\DriverSearching\" -Name \"DriverUpdateWizardWuSearchEnabled\" -Type DWord -Value 0\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\WindowsUpdate\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\WindowsUpdate\" | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\WindowsUpdate\" -Name \"ExcludeWUDriversInQualityUpdate\" -Type DWord -Value 1\n}\n\n# Enable offering of drivers through Windows Update\nFunction EnableUpdateDriver {\n\tWrite-Output \"Enabling driver offering through Windows Update...\"\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Device Metadata\" -Name \"PreventDeviceMetadataFromNetwork\" -ErrorAction SilentlyContinue\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\DriverSearching\" -Name \"DontPromptForWindowsUpdate\" -ErrorAction SilentlyContinue\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\DriverSearching\" -Name \"DontSearchWindowsUpdate\" -ErrorAction SilentlyContinue\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\DriverSearching\" -Name \"DriverUpdateWizardWuSearchEnabled\" -ErrorAction SilentlyContinue\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\WindowsUpdate\" -Name \"ExcludeWUDriversInQualityUpdate\" -ErrorAction SilentlyContinue\n}\n\n# Disable Windows Update automatic restart\n# Note: This doesn't disable the need for the restart but rather tries to ensure that the restart doesn't happen in the least expected moment. Allow the machine to restart as soon as possible anyway.\nFunction DisableUpdateRestart {\n\tWrite-Output \"Disabling Windows Update automatic restart...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\WindowsUpdate\\AU\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\WindowsUpdate\\AU\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\WindowsUpdate\\AU\" -Name \"NoAutoRebootWithLoggedOnUsers\" -Type DWord -Value 1\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\WindowsUpdate\\AU\" -Name \"AUPowerManagement\" -Type DWord -Value 0\n}\n\n# Enable Windows Update automatic restart\nFunction EnableUpdateRestart {\n\tWrite-Output \"Enabling Windows Update automatic restart...\"\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\WindowsUpdate\\AU\" -Name \"NoAutoRebootWithLoggedOnUsers\" -ErrorAction SilentlyContinue\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\WindowsUpdate\\AU\" -Name \"AUPowerManagement\" -ErrorAction SilentlyContinue\n}\n\n# Stop and disable Home Groups services - Not applicable to 1803 and newer or Server\nFunction DisableHomeGroups {\n\tWrite-Output \"Stopping and disabling Home Groups services...\"\n\tStop-Service \"HomeGroupListener\" -WarningAction SilentlyContinue\n\tSet-Service \"HomeGroupListener\" -StartupType Disabled\n\tStop-Service \"HomeGroupProvider\" -WarningAction SilentlyContinue\n\tSet-Service \"HomeGroupProvider\" -StartupType Disabled\n}\n\n# Enable and start Home Groups services - Not applicable to 1803 and newer or Server\nFunction EnableHomeGroups {\n\tWrite-Output \"Starting and enabling Home Groups services...\"\n\tSet-Service \"HomeGroupListener\" -StartupType Manual\n\tSet-Service \"HomeGroupProvider\" -StartupType Manual\n\tStart-Service \"HomeGroupProvider\" -WarningAction SilentlyContinue\n}\n\n# Disable Shared Experiences - Not applicable to Server\nFunction DisableSharedExperiences {\n\tWrite-Output \"Disabling Shared Experiences...\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\" -Name \"EnableCdp\" -Type DWord -Value 0\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\" -Name \"EnableMmx\" -Type DWord -Value 0\n}\n\n# Enable Shared Experiences - Not applicable to Server\nFunction EnableSharedExperiences {\n\tWrite-Output \"Enabling Shared Experiences...\"\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\" -Name \"EnableCdp\" -ErrorAction SilentlyContinue\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\" -Name \"EnableMmx\" -ErrorAction SilentlyContinue\n}\n\n# Disable Remote Assistance - Not applicable to Server (unless Remote Assistance is explicitly installed)\nFunction DisableRemoteAssistance {\n\tWrite-Output \"Disabling Remote Assistance...\"\n\tSet-ItemProperty -Path \"HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Remote Assistance\" -Name \"fAllowToGetHelp\" -Type DWord -Value 0\n}\n\n# Enable Remote Assistance - Not applicable to Server (unless Remote Assistance is explicitly installed)\nFunction EnableRemoteAssistance {\n\tWrite-Output \"Enabling Remote Assistance...\"\n\tSet-ItemProperty -Path \"HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Remote Assistance\" -Name \"fAllowToGetHelp\" -Type DWord -Value 1\n}\n\n# Enable Remote Desktop w/o Network Level Authentication\nFunction EnableRemoteDesktop {\n\tWrite-Output \"Enabling Remote Desktop w/o Network Level Authentication...\"\n\tSet-ItemProperty -Path \"HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server\" -Name \"fDenyTSConnections\" -Type DWord -Value 0\n\tSet-ItemProperty -Path \"HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server\\WinStations\\RDP-Tcp\" -Name \"UserAuthentication\" -Type DWord -Value 0\n\tEnable-NetFirewallRule -Name \"RemoteDesktop*\"\n}\n\n# Disable Remote Desktop\nFunction DisableRemoteDesktop {\n\tWrite-Output \"Disabling Remote Desktop...\"\n\tSet-ItemProperty -Path \"HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server\" -Name \"fDenyTSConnections\" -Type DWord -Value 1\n\tSet-ItemProperty -Path \"HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server\\WinStations\\RDP-Tcp\" -Name \"UserAuthentication\" -Type DWord -Value 1\n\tDisable-NetFirewallRule -Name \"RemoteDesktop*\"\n}\n\n# Disable Autoplay\nFunction DisableAutoplay {\n\tWrite-Output \"Disabling Autoplay...\"\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\AutoplayHandlers\" -Name \"DisableAutoplay\" -Type DWord -Value 1\n}\n\n# Enable Autoplay\nFunction EnableAutoplay {\n\tWrite-Output \"Enabling Autoplay...\"\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\AutoplayHandlers\" -Name \"DisableAutoplay\" -Type DWord -Value 0\n}\n\n# Disable Autorun for all drives\nFunction DisableAutorun {\n\tWrite-Output \"Disabling Autorun for all drives...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\" | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\" -Name \"NoDriveTypeAutoRun\" -Type DWord -Value 255\n}\n\n# Enable Autorun for removable drives\nFunction EnableAutorun {\n\tWrite-Output \"Enabling Autorun for all drives...\"\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\" -Name \"NoDriveTypeAutoRun\" -ErrorAction SilentlyContinue\n}\n\n# Enable Storage Sense - automatic disk cleanup - Not applicable to Server\nFunction EnableStorageSense {\n\tWrite-Output \"Enabling Storage Sense...\"\n\tIf (!(Test-Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\StorageSense\\Parameters\\StoragePolicy\")) {\n\t\tNew-Item -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\StorageSense\\Parameters\\StoragePolicy\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\StorageSense\\Parameters\\StoragePolicy\" -Name \"01\" -Type DWord -Value 1\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\StorageSense\\Parameters\\StoragePolicy\" -Name \"04\" -Type DWord -Value 1\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\StorageSense\\Parameters\\StoragePolicy\" -Name \"08\" -Type DWord -Value 1\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\StorageSense\\Parameters\\StoragePolicy\" -Name \"32\" -Type DWord -Value 0\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\StorageSense\\Parameters\\StoragePolicy\" -Name \"StoragePoliciesNotified\" -Type DWord -Value 1\n}\n\n# Disable Storage Sense - Not applicable to Server\nFunction DisableStorageSense {\n\tWrite-Output \"Disabling Storage Sense...\"\n\tRemove-Item -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\StorageSense\\Parameters\\StoragePolicy\" -Recurse -ErrorAction SilentlyContinue\n}\n\n# Disable scheduled defragmentation task\nFunction DisableDefragmentation {\n\tWrite-Output \"Disabling scheduled defragmentation...\"\n\tDisable-ScheduledTask -TaskName \"Microsoft\\Windows\\Defrag\\ScheduledDefrag\" | Out-Null\n}\n\n# Enable scheduled defragmentation task\nFunction EnableDefragmentation {\n\tWrite-Output \"Enabling scheduled defragmentation...\"\n\tEnable-ScheduledTask -TaskName \"Microsoft\\Windows\\Defrag\\ScheduledDefrag\" | Out-Null\n}\n\n# Stop and disable Superfetch service - Not applicable to Server\nFunction DisableSuperfetch {\n\tWrite-Output \"Stopping and disabling Superfetch service...\"\n\tStop-Service \"SysMain\" -WarningAction SilentlyContinue\n\tSet-Service \"SysMain\" -StartupType Disabled\n}\n\n# Start and enable Superfetch service - Not applicable to Server\nFunction EnableSuperfetch {\n\tWrite-Output \"Starting and enabling Superfetch service...\"\n\tSet-Service \"SysMain\" -StartupType Automatic\n\tStart-Service \"SysMain\" -WarningAction SilentlyContinue\n}\n\n# Stop and disable Windows Search indexing service\nFunction DisableIndexing {\n\tWrite-Output \"Stopping and disabling Windows Search indexing service...\"\n\tStop-Service \"WSearch\" -WarningAction SilentlyContinue\n\tSet-Service \"WSearch\" -StartupType Disabled\n}\n\n# Start and enable Windows Search indexing service\nFunction EnableIndexing {\n\tWrite-Output \"Starting and enabling Windows Search indexing service...\"\n\tSet-Service \"WSearch\" -StartupType Automatic\n\tSet-ItemProperty -Path \"HKLM:\\SYSTEM\\CurrentControlSet\\Services\\WSearch\" -Name \"DelayedAutoStart\" -Type DWord -Value 1\n\tStart-Service \"WSearch\" -WarningAction SilentlyContinue\n}\n\n# Set BIOS time to UTC\nFunction SetBIOSTimeUTC {\n\tWrite-Output \"Setting BIOS time to UTC...\"\n\tSet-ItemProperty -Path \"HKLM:\\SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation\" -Name \"RealTimeIsUniversal\" -Type DWord -Value 1\n}\n\n# Set BIOS time to local time\nFunction SetBIOSTimeLocal {\n\tWrite-Output \"Setting BIOS time to Local time...\"\n\tRemove-ItemProperty -Path \"HKLM:\\SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation\" -Name \"RealTimeIsUniversal\" -ErrorAction SilentlyContinue\n}\n\n# Enable Hibernation - Do not use on Server with automatically started Hyper-V hvboot service as it may lead to BSODs (Win10 with Hyper-V is fine)\nFunction EnableHibernation {\n\tWrite-Output \"Enabling Hibernation...\"\n\tSet-ItemProperty -Path \"HKLM:\\System\\CurrentControlSet\\Control\\Session Manager\\Power\" -Name \"HibernteEnabled\" -Type Dword -Value 1\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FlyoutMenuSettings\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FlyoutMenuSettings\" | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FlyoutMenuSettings\" -Name \"ShowHibernateOption\" -Type Dword -Value 1\n}\n\n# Disable Hibernation\nFunction DisableHibernation {\n\tWrite-Output \"Disabling Hibernation...\"\n\tSet-ItemProperty -Path \"HKLM:\\System\\CurrentControlSet\\Control\\Session Manager\\Power\" -Name \"HibernteEnabled\" -Type Dword -Value 0\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FlyoutMenuSettings\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FlyoutMenuSettings\" | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FlyoutMenuSettings\" -Name \"ShowHibernateOption\" -Type Dword -Value 0\n}\n\n# Disable Sleep start menu and keyboard button\nFunction DisableSleepButton {\n\tWrite-Output \"Disabling Sleep start menu and keyboard button...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FlyoutMenuSettings\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FlyoutMenuSettings\" | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FlyoutMenuSettings\" -Name \"ShowSleepOption\" -Type Dword -Value 0\n\tpowercfg /SETACVALUEINDEX SCHEME_CURRENT SUB_BUTTONS SBUTTONACTION 0\n\tpowercfg /SETDCVALUEINDEX SCHEME_CURRENT SUB_BUTTONS SBUTTONACTION 0\n}\n\n# Enable Sleep start menu and keyboard button\nFunction EnableSleepButton {\n\tWrite-Output \"Enabling Sleep start menu and keyboard button...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FlyoutMenuSettings\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FlyoutMenuSettings\" | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FlyoutMenuSettings\" -Name \"ShowSleepOption\" -Type Dword -Value 1\n\tpowercfg /SETACVALUEINDEX SCHEME_CURRENT SUB_BUTTONS SBUTTONACTION 1\n\tpowercfg /SETDCVALUEINDEX SCHEME_CURRENT SUB_BUTTONS SBUTTONACTION 1\n}\n\n# Disable display and sleep mode timeouts\nFunction DisableSleepTimeout {\n\tWrite-Output \"Disabling display and sleep mode timeouts...\"\n\tpowercfg /X monitor-timeout-ac 0\n\tpowercfg /X monitor-timeout-dc 0\n\tpowercfg /X standby-timeout-ac 0\n\tpowercfg /X standby-timeout-dc 0\n}\n\n# Enable display and sleep mode timeouts\nFunction EnableSleepTimeout {\n\tWrite-Output \"Enabling display and sleep mode timeouts...\"\n\tpowercfg /X monitor-timeout-ac 10\n\tpowercfg /X monitor-timeout-dc 5\n\tpowercfg /X standby-timeout-ac 30\n\tpowercfg /X standby-timeout-dc 15\n}\n\n# Disable Fast Startup\nFunction DisableFastStartup {\n\tWrite-Output \"Disabling Fast Startup...\"\n\tSet-ItemProperty -Path \"HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Power\" -Name \"HiberbootEnabled\" -Type DWord -Value 0\n}\n\n# Enable Fast Startup\nFunction EnableFastStartup {\n\tWrite-Output \"Enabling Fast Startup...\"\n\tSet-ItemProperty -Path \"HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Power\" -Name \"HiberbootEnabled\" -Type DWord -Value 1\n}\n\n\n\n##########\n# UI Tweaks\n##########\n\n# Disable Action Center\nFunction DisableActionCenter {\n\tWrite-Output \"Disabling Action Center...\"\n\tIf (!(Test-Path \"HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer\")) {\n\t\tNew-Item -Path \"HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer\" | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer\" -Name \"DisableNotificationCenter\" -Type DWord -Value 1\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\PushNotifications\" -Name \"ToastEnabled\" -Type DWord -Value 0\n}\n\n# Enable Action Center\nFunction EnableActionCenter {\n\tWrite-Output \"Enabling Action Center...\"\n\tRemove-ItemProperty -Path \"HKCU:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer\" -Name \"DisableNotificationCenter\" -ErrorAction SilentlyContinue\n\tRemove-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\PushNotifications\" -Name \"ToastEnabled\" -ErrorAction SilentlyContinue\n}\n\n# Disable Lock screen\nFunction DisableLockScreen {\n\tWrite-Output \"Disabling Lock screen...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Personalization\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Personalization\" | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Personalization\" -Name \"NoLockScreen\" -Type DWord -Value 1\n}\n\n# Enable Lock screen\nFunction EnableLockScreen {\n\tWrite-Output \"Enabling Lock screen...\"\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Personalization\" -Name \"NoLockScreen\" -ErrorAction SilentlyContinue\n}\n\n# Disable Lock screen (Anniversary Update workaround) - Applicable to 1607 - 1803 (The GPO used in DisableLockScreen has been fixed again in 1803)\nFunction DisableLockScreenRS1 {\n\tWrite-Output \"Disabling Lock screen using scheduler workaround...\"\n\t$service = New-Object -com Schedule.Service\n\t$service.Connect()\n\t$task = $service.NewTask(0)\n\t$task.Settings.DisallowStartIfOnBatteries = $false\n\t$trigger = $task.Triggers.Create(9)\n\t$trigger = $task.Triggers.Create(11)\n\t$trigger.StateChange = 8\n\t$action = $task.Actions.Create(0)\n\t$action.Path = \"reg.exe\"\n\t$action.Arguments = \"add HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Authentication\\LogonUI\\SessionData /t REG_DWORD /v AllowLockScreen /d 0 /f\"\n\t$service.GetFolder(\"\\\").RegisterTaskDefinition(\"Disable LockScreen\", $task, 6, \"NT AUTHORITY\\SYSTEM\", $null, 4) | Out-Null\n}\n\n# Enable Lock screen (Anniversary Update workaround) - Applicable to 1607 - 1803\nFunction EnableLockScreenRS1 {\n\tWrite-Output \"Enabling Lock screen (removing scheduler workaround)...\"\n\tUnregister-ScheduledTask -TaskName \"Disable LockScreen\" -Confirm:$false -ErrorAction SilentlyContinue\n}\n\n# Hide network options from Lock Screen\nFunction HideNetworkFromLockScreen {\n\tWrite-Output \"Hiding network options from Lock Screen...\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\" -Name \"DontDisplayNetworkSelectionUI\" -Type DWord -Value 1\n}\n\n# Show network options on lock screen\nFunction ShowNetworkOnLockScreen {\n\tWrite-Output \"Showing network options on Lock Screen...\"\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\System\" -Name \"DontDisplayNetworkSelectionUI\" -ErrorAction SilentlyContinue\n}\n\n# Hide shutdown options from Lock Screen\nFunction HideShutdownFromLockScreen {\n\tWrite-Output \"Hiding shutdown options from Lock Screen...\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\" -Name \"ShutdownWithoutLogon\" -Type DWord -Value 0\n}\n\n# Show shutdown options on lock screen\nFunction ShowShutdownOnLockScreen {\n\tWrite-Output \"Showing shutdown options on Lock Screen...\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\" -Name \"ShutdownWithoutLogon\" -Type DWord -Value 1\n}\n\n# Disable Sticky keys prompt\nFunction DisableStickyKeys {\n\tWrite-Output \"Disabling Sticky keys prompt...\"\n\tSet-ItemProperty -Path \"HKCU:\\Control Panel\\Accessibility\\StickyKeys\" -Name \"Flags\" -Type String -Value \"506\"\n}\n\n# Enable Sticky keys prompt\nFunction EnableStickyKeys {\n\tWrite-Output \"Enabling Sticky keys prompt...\"\n\tSet-ItemProperty -Path \"HKCU:\\Control Panel\\Accessibility\\StickyKeys\" -Name \"Flags\" -Type String -Value \"510\"\n}\n\n# Show Task Manager details - Applicable to 1607 and later - Although this functionality exist even in earlier versions, the Task Manager's behavior is different there and is not compatible with this tweak\nFunction ShowTaskManagerDetails {\n\tWrite-Output \"Showing task manager details...\"\n\t$taskmgr = Start-Process -WindowStyle Hidden -FilePath taskmgr.exe -PassThru\n\tDo {\n\t\tStart-Sleep -Milliseconds 100\n\t\t$preferences = Get-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\TaskManager\" -Name \"Preferences\" -ErrorAction SilentlyContinue\n\t} Until ($preferences)\n\tStop-Process $taskmgr\n\t$preferences.Preferences[28] = 0\n\tSet-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\TaskManager\" -Name \"Preferences\" -Type Binary -Value $preferences.Preferences\n}\n\n# Hide Task Manager details\nFunction HideTaskManagerDetails {\n\tWrite-Output \"Hiding task manager details...\"\n\t$preferences = Get-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\TaskManager\" -Name \"Preferences\" -ErrorAction SilentlyContinue\n\tIf ($preferences) {\n\t\t$preferences.Preferences[28] = 1\n\t\tSet-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\TaskManager\" -Name \"Preferences\" -Type Binary -Value $preferences.Preferences\n\t}\n}\n\n# Show file operations details\nFunction ShowFileOperationsDetails {\n\tWrite-Output \"Showing file operations details...\"\n\tIf (!(Test-Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\OperationStatusManager\")) {\n\t\tNew-Item -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\OperationStatusManager\" | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\OperationStatusManager\" -Name \"EnthusiastMode\" -Type DWord -Value 1\n}\n\n# Hide file operations details\nFunction HideFileOperationsDetails {\n\tWrite-Output \"Hiding file operations details...\"\n\tRemove-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\OperationStatusManager\" -Name \"EnthusiastMode\" -ErrorAction SilentlyContinue\n}\n\n# Enable file delete confirmation dialog\nFunction EnableFileDeleteConfirm {\n\tWrite-Output \"Enabling file delete confirmation dialog...\"\n\tIf (!(Test-Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\")) {\n\t\tNew-Item -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\" | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\" -Name \"ConfirmFileDelete\" -Type DWord -Value 1\n}\n\n# Disable file delete confirmation dialog\nFunction DisableFileDeleteConfirm {\n\tWrite-Output \"Disabling file delete confirmation dialog...\"\n\tRemove-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\" -Name \"ConfirmFileDelete\" -ErrorAction SilentlyContinue\n}\n\n# Hide Taskbar Search icon / box\nFunction HideTaskbarSearch {\n\tWrite-Output \"Hiding Taskbar Search icon / box...\"\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Search\" -Name \"SearchboxTaskbarMode\" -Type DWord -Value 0\n}\n\n# Show Taskbar Search icon\nFunction ShowTaskbarSearchIcon {\n\tWrite-Output \"Showing Taskbar Search icon...\"\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Search\" -Name \"SearchboxTaskbarMode\" -Type DWord -Value 1\n}\n\n# Show Taskbar Search box\nFunction ShowTaskbarSearchBox {\n\tWrite-Output \"Showing Taskbar Search box...\"\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Search\" -Name \"SearchboxTaskbarMode\" -Type DWord -Value 2\n}\n\n# Hide Task View button\nFunction HideTaskView {\n\tWrite-Output \"Hiding Task View button...\"\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" -Name \"ShowTaskViewButton\" -Type DWord -Value 0\n}\n\n# Show Task View button\nFunction ShowTaskView {\n\tWrite-Output \"Showing Task View button...\"\n\tRemove-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" -Name \"ShowTaskViewButton\" -ErrorAction SilentlyContinue\n}\n\n# Show small icons in taskbar\nFunction ShowSmallTaskbarIcons {\n\tWrite-Output \"Showing small icons in taskbar...\"\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" -Name \"TaskbarSmallIcons\" -Type DWord -Value 1\n}\n\n# Show large icons in taskbar\nFunction ShowLargeTaskbarIcons {\n\tWrite-Output \"Showing large icons in taskbar...\"\n\tRemove-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" -Name \"TaskbarSmallIcons\" -ErrorAction SilentlyContinue\n}\n\n# Set taskbar buttons to show labels and combine when taskbar is full\nFunction SetTaskbarCombineWhenFull {\n\tWrite-Output \"Setting taskbar buttons to combine when taskbar is full...\"\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" -Name \"TaskbarGlomLevel\" -Type DWord -Value 1\n}\n\n# Set taskbar buttons to show labels and never combine\nFunction SetTaskbarCombineNever {\n\tWrite-Output \"Setting taskbar buttons to never combine...\"\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" -Name \"TaskbarGlomLevel\" -Type DWord -Value 2\n}\n\n# Set taskbar buttons to always combine and hide labels\nFunction SetTaskbarCombineAlways {\n\tWrite-Output \"Setting taskbar buttons to always combine, hide labels...\"\n\tRemove-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" -Name \"TaskbarGlomLevel\" -ErrorAction SilentlyContinue\n}\n\n# Hide Taskbar People icon\nFunction HideTaskbarPeopleIcon {\n\tWrite-Output \"Hiding People icon...\"\n\tIf (!(Test-Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\People\")) {\n\t\tNew-Item -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\People\" | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\People\" -Name \"PeopleBand\" -Type DWord -Value 0\n}\n\n# Show Taskbar People icon\nFunction ShowTaskbarPeopleIcon {\n\tWrite-Output \"Showing People icon...\"\n\tRemove-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\\People\" -Name \"PeopleBand\" -ErrorAction SilentlyContinue\n}\n\n# Show all tray icons\nFunction ShowTrayIcons {\n\tWrite-Output \"Showing all tray icons...\"\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\" -Name \"EnableAutoTray\" -Type DWord -Value 0\n}\n\n# Hide tray icons as needed\nFunction HideTrayIcons {\n\tWrite-Output \"Hiding tray icons...\"\n\tRemove-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\" -Name \"EnableAutoTray\" -ErrorAction SilentlyContinue\n}\n\n# Disable search for app in store for unknown extensions\nFunction DisableSearchAppInStore {\n\tWrite-Output \"Disabling search for app in store for unknown extensions...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer\" | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer\" -Name \"NoUseStoreOpenWith\" -Type DWord -Value 1\n}\n\n# Enable search for app in store for unknown extensions\nFunction EnableSearchAppInStore {\n\tWrite-Output \"Enabling search for app in store for unknown extensions...\"\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer\" -Name \"NoUseStoreOpenWith\" -ErrorAction SilentlyContinue\n}\n\n# Disable 'How do you want to open this file?' prompt\nFunction DisableNewAppPrompt {\n\tWrite-Output \"Disabling 'How do you want to open this file?' prompt...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer\" | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer\" -Name \"NoNewAppAlert\" -Type DWord -Value 1\n}\n\n# Enable 'How do you want to open this file?' prompt\nFunction EnableNewAppPrompt {\n\tWrite-Output \"Enabling 'How do you want to open this file?' prompt...\"\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Explorer\" -Name \"NoNewAppAlert\" -ErrorAction SilentlyContinue\n}\n\n# Set Control Panel view to Small icons (Classic)\nFunction SetControlPanelSmallIcons {\n\tWrite-Output \"Setting Control Panel view to small icons...\"\n\tIf (!(Test-Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ControlPanel\")) {\n\t\tNew-Item -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ControlPanel\" | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ControlPanel\" -Name \"StartupPage\" -Type DWord -Value 1\n\tSet-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ControlPanel\" -Name \"AllItemsIconView\" -Type DWord -Value 1\n}\n\n# Set Control Panel view to Large icons (Classic)\nFunction SetControlPanelLargeIcons {\n\tWrite-Output \"Setting Control Panel view to large icons...\"\n\tIf (!(Test-Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ControlPanel\")) {\n\t\tNew-Item -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ControlPanel\" | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ControlPanel\" -Name \"StartupPage\" -Type DWord -Value 1\n\tSet-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ControlPanel\" -Name \"AllItemsIconView\" -Type DWord -Value 0\n}\n\n# Set Control Panel view to categories\nFunction SetControlPanelCategories {\n\tWrite-Output \"Setting Control Panel view to categories...\"\n\tRemove-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ControlPanel\" -Name \"StartupPage\" -ErrorAction SilentlyContinue\n\tRemove-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ControlPanel\" -Name \"AllItemsIconView\" -ErrorAction SilentlyContinue\n}\n\n# Adjusts visual effects for performance - Disables animations, transparency etc. but leaves font smoothing and miniatures enabled\nFunction SetVisualFXPerformance {\n\tWrite-Output \"Adjusting visual effects for performance...\"\n\tSet-ItemProperty -Path \"HKCU:\\Control Panel\\Desktop\" -Name \"DragFullWindows\" -Type String -Value 0\n\tSet-ItemProperty -Path \"HKCU:\\Control Panel\\Desktop\" -Name \"MenuShowDelay\" -Type String -Value 0\n\tSet-ItemProperty -Path \"HKCU:\\Control Panel\\Desktop\" -Name \"UserPreferencesMask\" -Type Binary -Value ([byte[]](144,18,3,128,16,0,0,0))\n\tSet-ItemProperty -Path \"HKCU:\\Control Panel\\Desktop\\WindowMetrics\" -Name \"MinAnimate\" -Type String -Value 0\n\tSet-ItemProperty -Path \"HKCU:\\Control Panel\\Keyboard\" -Name \"KeyboardDelay\" -Type DWord -Value 0\n\tSet-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" -Name \"ListviewAlphaSelect\" -Type DWord -Value 0\n\tSet-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" -Name \"ListviewShadow\" -Type DWord -Value 0\n\tSet-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" -Name \"TaskbarAnimations\" -Type DWord -Value 0\n\tSet-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\VisualEffects\" -Name \"VisualFXSetting\" -Type DWord -Value 3\n\tSet-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\DWM\" -Name \"EnableAeroPeek\" -Type DWord -Value 0\n}\n\n# Adjusts visual effects for appearance\nFunction SetVisualFXAppearance {\n\tWrite-Output \"Adjusting visual effects for appearance...\"\n\tSet-ItemProperty -Path \"HKCU:\\Control Panel\\Desktop\" -Name \"DragFullWindows\" -Type String -Value 1\n\tSet-ItemProperty -Path \"HKCU:\\Control Panel\\Desktop\" -Name \"MenuShowDelay\" -Type String -Value 400\n\tSet-ItemProperty -Path \"HKCU:\\Control Panel\\Desktop\" -Name \"UserPreferencesMask\" -Type Binary -Value ([byte[]](158,30,7,128,18,0,0,0))\n\tSet-ItemProperty -Path \"HKCU:\\Control Panel\\Desktop\\WindowMetrics\" -Name \"MinAnimate\" -Type String -Value 1\n\tSet-ItemProperty -Path \"HKCU:\\Control Panel\\Keyboard\" -Name \"KeyboardDelay\" -Type DWord -Value 1\n\tSet-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" -Name \"ListviewAlphaSelect\" -Type DWord -Value 1\n\tSet-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" -Name \"ListviewShadow\" -Type DWord -Value 1\n\tSet-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" -Name \"TaskbarAnimations\" -Type DWord -Value 1\n\tSet-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\VisualEffects\" -Name \"VisualFXSetting\" -Type DWord -Value 3\n\tSet-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\DWM\" -Name \"EnableAeroPeek\" -Type DWord -Value 1\n}\n\n# Add secondary en-US keyboard\nFunction AddENKeyboard {\n\tWrite-Output \"Adding secondary en-US keyboard...\"\n\t$langs = Get-WinUserLanguageList\n\t$langs.Add(\"en-US\")\n\tSet-WinUserLanguageList $langs -Force\n}\n\n# Remove secondary en-US keyboard\nFunction RemoveENKeyboard {\n\tWrite-Output \"Removing secondary en-US keyboard...\"\n\t$langs = Get-WinUserLanguageList\n\tSet-WinUserLanguageList ($langs | ? {$_.LanguageTag -ne \"en-US\"}) -Force\n}\n\n# Enable NumLock after startup\nFunction EnableNumlock {\n\tWrite-Output \"Enabling NumLock after startup...\"\n\tIf (!(Test-Path \"HKU:\")) {\n\t\tNew-PSDrive -Name HKU -PSProvider Registry -Root HKEY_USERS | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKU:\\.DEFAULT\\Control Panel\\Keyboard\" -Name \"InitialKeyboardIndicators\" -Type DWord -Value 2147483650\n\tAdd-Type -AssemblyName System.Windows.Forms\n\tIf (!([System.Windows.Forms.Control]::IsKeyLocked('NumLock'))) {\n\t\t$wsh = New-Object -ComObject WScript.Shell\n\t\t$wsh.SendKeys('{NUMLOCK}')\n\t}\n}\n\n# Disable NumLock after startup\nFunction DisableNumlock {\n\tWrite-Output \"Disabling NumLock after startup...\"\n\tIf (!(Test-Path \"HKU:\")) {\n\t\tNew-PSDrive -Name HKU -PSProvider Registry -Root HKEY_USERS | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKU:\\.DEFAULT\\Control Panel\\Keyboard\" -Name \"InitialKeyboardIndicators\" -Type DWord -Value 2147483648\n\tAdd-Type -AssemblyName System.Windows.Forms\n\tIf ([System.Windows.Forms.Control]::IsKeyLocked('NumLock')) {\n\t\t$wsh = New-Object -ComObject WScript.Shell\n\t\t$wsh.SendKeys('{NUMLOCK}')\n\t}\n}\n\n\n\n##########\n# Explorer UI Tweaks\n##########\n\n# Show known file extensions\nFunction ShowKnownExtensions {\n\tWrite-Output \"Showing known file extensions...\"\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" -Name \"HideFileExt\" -Type DWord -Value 0\n}\n\n# Hide known file extensions\nFunction HideKnownExtensions {\n\tWrite-Output \"Hiding known file extensions...\"\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" -Name \"HideFileExt\" -Type DWord -Value 1\n}\n\n# Show hidden files\nFunction ShowHiddenFiles {\n\tWrite-Output \"Showing hidden files...\"\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" -Name \"Hidden\" -Type DWord -Value 1\n}\n\n# Hide hidden files\nFunction HideHiddenFiles {\n\tWrite-Output \"Hiding hidden files...\"\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" -Name \"Hidden\" -Type DWord -Value 2\n}\n\n# Hide sync provider notifications\nFunction HideSyncNotifications {\n\tWrite-Output \"Hiding sync provider notifications...\"\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" -Name \"ShowSyncProviderNotifications\" -Type DWord -Value 0\n}\n\n# Show sync provider notifications\nFunction ShowSyncNotifications {\n\tWrite-Output \"Showing sync provider notifications...\"\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" -Name \"ShowSyncProviderNotifications\" -Type DWord -Value 1\n}\n\n# Hide recently and frequently used item shortcuts in Explorer\nFunction HideRecentShortcuts {\n\tWrite-Output \"Hiding recent shortcuts...\"\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\" -Name \"ShowRecent\" -Type DWord -Value 0\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\" -Name \"ShowFrequent\" -Type DWord -Value 0\n}\n\n# Show recently and frequently used item shortcuts in Explorer\nFunction ShowRecentShortcuts {\n\tWrite-Output \"Showing recent shortcuts...\"\n\tRemove-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\" -Name \"ShowRecent\" -ErrorAction SilentlyContinue\n\tRemove-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\" -Name \"ShowFrequent\" -ErrorAction SilentlyContinue\n}\n\n# Change default Explorer view to This PC\nFunction SetExplorerThisPC {\n\tWrite-Output \"Changing default Explorer view to This PC...\"\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" -Name \"LaunchTo\" -Type DWord -Value 1\n}\n\n# Change default Explorer view to Quick Access\nFunction SetExplorerQuickAccess {\n\tWrite-Output \"Changing default Explorer view to Quick Access...\"\n\tRemove-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" -Name \"LaunchTo\" -ErrorAction SilentlyContinue\n}\n\n# Show This PC shortcut on desktop\nFunction ShowThisPCOnDesktop {\n\tWrite-Output \"Showing This PC shortcut on desktop...\"\n\tIf (!(Test-Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HideDesktopIcons\\ClassicStartMenu\")) {\n\t\tNew-Item -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HideDesktopIcons\\ClassicStartMenu\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HideDesktopIcons\\ClassicStartMenu\" -Name \"{20D04FE0-3AEA-1069-A2D8-08002B30309D}\" -Type DWord -Value 0\n\tIf (!(Test-Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HideDesktopIcons\\NewStartPanel\")) {\n\t\tNew-Item -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HideDesktopIcons\\NewStartPanel\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HideDesktopIcons\\NewStartPanel\" -Name \"{20D04FE0-3AEA-1069-A2D8-08002B30309D}\" -Type DWord -Value 0\n}\n\n# Hide This PC shortcut from desktop\nFunction HideThisPCFromDesktop {\n\tWrite-Output \"Hiding This PC shortcut from desktop...\"\n\tRemove-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HideDesktopIcons\\ClassicStartMenu\" -Name \"{20D04FE0-3AEA-1069-A2D8-08002B30309D}\" -ErrorAction SilentlyContinue\n\tRemove-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HideDesktopIcons\\NewStartPanel\" -Name \"{20D04FE0-3AEA-1069-A2D8-08002B30309D}\" -ErrorAction SilentlyContinue\n}\n\n# Show User Folder shortcut on desktop\nFunction ShowUserFolderOnDesktop {\n\tWrite-Output \"Showing User Folder shortcut on desktop...\"\n\tIf (!(Test-Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HideDesktopIcons\\ClassicStartMenu\")) {\n\t\tNew-Item -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HideDesktopIcons\\ClassicStartMenu\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HideDesktopIcons\\ClassicStartMenu\" -Name \"{59031a47-3f72-44a7-89c5-5595fe6b30ee}\" -Type DWord -Value 0\n\tIf (!(Test-Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HideDesktopIcons\\NewStartPanel\")) {\n\t\tNew-Item -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HideDesktopIcons\\NewStartPanel\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HideDesktopIcons\\NewStartPanel\" -Name \"{59031a47-3f72-44a7-89c5-5595fe6b30ee}\" -Type DWord -Value 0\n}\n\n# Hide User Folder shortcut from desktop\nFunction HideUserFolderFromDesktop {\n\tWrite-Output \"Hiding User Folder shortcut from desktop...\"\n\tRemove-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HideDesktopIcons\\ClassicStartMenu\" -Name \"{59031a47-3f72-44a7-89c5-5595fe6b30ee}\" -ErrorAction SilentlyContinue\n\tRemove-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HideDesktopIcons\\NewStartPanel\" -Name \"{59031a47-3f72-44a7-89c5-5595fe6b30ee}\" -ErrorAction SilentlyContinue\n}\n\n# Hide Desktop icon from This PC - The icon remains in personal folders and open/save dialogs\nFunction HideDesktopFromThisPC {\n\tWrite-Output \"Hiding Desktop icon from This PC...\"\n\tRemove-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\" -Recurse -ErrorAction SilentlyContinue\n}\n\n# Show Desktop icon in This PC\nFunction ShowDesktopInThisPC {\n\tWrite-Output \"Showing Desktop icon in This PC...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\" | Out-Null\n\t}\n}\n\n# Hide Desktop icon from Explorer namespace - Hides the icon also from personal folders and open/save dialogs\nFunction HideDesktopFromExplorer {\n\tWrite-Output \"Hiding Desktop icon from Explorer namespace...\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\\PropertyBag\" -Name \"ThisPCPolicy\" -Type String -Value \"Hide\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\\PropertyBag\" -Name \"ThisPCPolicy\" -Type String -Value \"Hide\"\n}\n\n# Show Desktop icon in Explorer namespace\nFunction ShowDesktopInExplorer {\n\tWrite-Output \"Showing Desktop icon in Explorer namespace...\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\\PropertyBag\" -Name \"ThisPCPolicy\" -Type String -Value \"Show\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\\PropertyBag\" -Name \"ThisPCPolicy\" -Type String -Value \"Show\"\n}\n\n# Hide Documents icon from This PC - The icon remains in personal folders and open/save dialogs\nFunction HideDocumentsFromThisPC {\n\tWrite-Output \"Hiding Documents icon from This PC...\"\n\tRemove-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{d3162b92-9365-467a-956b-92703aca08af}\" -Recurse -ErrorAction SilentlyContinue\n\tRemove-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{A8CDFF1C-4878-43be-B5FD-F8091C1C60D0}\" -Recurse -ErrorAction SilentlyContinue\n}\n\n# Show Documents icon in This PC\nFunction ShowDocumentsInThisPC {\n\tWrite-Output \"Showing Documents icon in This PC...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{d3162b92-9365-467a-956b-92703aca08af}\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{d3162b92-9365-467a-956b-92703aca08af}\" | Out-Null\n\t}\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{A8CDFF1C-4878-43be-B5FD-F8091C1C60D0}\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{A8CDFF1C-4878-43be-B5FD-F8091C1C60D0}\" | Out-Null\n\t}\n}\n\n# Hide Documents icon from Explorer namespace - Hides the icon also from personal folders and open/save dialogs\nFunction HideDocumentsFromExplorer {\n\tWrite-Output \"Hiding Documents icon from Explorer namespace...\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\\PropertyBag\" -Name \"ThisPCPolicy\" -Type String -Value \"Hide\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\\PropertyBag\" -Name \"ThisPCPolicy\" -Type String -Value \"Hide\"\n}\n\n# Show Documents icon in Explorer namespace\nFunction ShowDocumentsInExplorer {\n\tWrite-Output \"Showing Documents icon in Explorer namespace...\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\\PropertyBag\" -Name \"ThisPCPolicy\" -Type String -Value \"Show\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\\PropertyBag\" -Name \"ThisPCPolicy\" -Type String -Value \"Show\"\n}\n\n# Hide Downloads icon from This PC - The icon remains in personal folders and open/save dialogs\nFunction HideDownloadsFromThisPC {\n\tWrite-Output \"Hiding Downloads icon from This PC...\"\n\tRemove-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{088e3905-0323-4b02-9826-5d99428e115f}\" -Recurse -ErrorAction SilentlyContinue\n\tRemove-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{374DE290-123F-4565-9164-39C4925E467B}\" -Recurse -ErrorAction SilentlyContinue\n}\n\n# Show Downloads icon in This PC\nFunction ShowDownloadsInThisPC {\n\tWrite-Output \"Showing Downloads icon in This PC...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{088e3905-0323-4b02-9826-5d99428e115f}\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{088e3905-0323-4b02-9826-5d99428e115f}\" | Out-Null\n\t}\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{374DE290-123F-4565-9164-39C4925E467B}\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{374DE290-123F-4565-9164-39C4925E467B}\" | Out-Null\n\t}\n}\n\n# Hide Downloads icon from Explorer namespace - Hides the icon also from personal folders and open/save dialogs\nFunction HideDownloadsFromExplorer {\n\tWrite-Output \"Hiding Downloads icon from Explorer namespace...\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\\PropertyBag\" -Name \"ThisPCPolicy\" -Type String -Value \"Hide\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\\PropertyBag\" -Name \"ThisPCPolicy\" -Type String -Value \"Hide\"\n}\n\n# Show Downloads icon in Explorer namespace\nFunction ShowDownloadsInExplorer {\n\tWrite-Output \"Showing Downloads icon in Explorer namespace...\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\\PropertyBag\" -Name \"ThisPCPolicy\" -Type String -Value \"Show\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\\PropertyBag\" -Name \"ThisPCPolicy\" -Type String -Value \"Show\"\n}\n\n# Hide Music icon from This PC - The icon remains in personal folders and open/save dialogs\nFunction HideMusicFromThisPC {\n\tWrite-Output \"Hiding Music icon from This PC...\"\n\tRemove-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{3dfdf296-dbec-4fb4-81d1-6a3438bcf4de}\" -Recurse -ErrorAction SilentlyContinue\n\tRemove-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{1CF1260C-4DD0-4ebb-811F-33C572699FDE}\" -Recurse -ErrorAction SilentlyContinue\n}\n\n# Show Music icon in This PC\nFunction ShowMusicInThisPC {\n\tWrite-Output \"Showing Music icon in This PC...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{3dfdf296-dbec-4fb4-81d1-6a3438bcf4de}\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{3dfdf296-dbec-4fb4-81d1-6a3438bcf4de}\" | Out-Null\n\t}\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{1CF1260C-4DD0-4ebb-811F-33C572699FDE}\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{1CF1260C-4DD0-4ebb-811F-33C572699FDE}\" | Out-Null\n\t}\n}\n\n# Hide Music icon from Explorer namespace - Hides the icon also from personal folders and open/save dialogs\nFunction HideMusicFromExplorer {\n\tWrite-Output \"Hiding Music icon from Explorer namespace...\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{a0c69a99-21c8-4671-8703-7934162fcf1d}\\PropertyBag\" -Name \"ThisPCPolicy\" -Type String -Value \"Hide\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{a0c69a99-21c8-4671-8703-7934162fcf1d}\\PropertyBag\" -Name \"ThisPCPolicy\" -Type String -Value \"Hide\"\n}\n\n# Show Music icon in Explorer namespace\nFunction ShowMusicInExplorer {\n\tWrite-Output \"Showing Music icon in Explorer namespace...\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{a0c69a99-21c8-4671-8703-7934162fcf1d}\\PropertyBag\" -Name \"ThisPCPolicy\" -Type String -Value \"Show\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{a0c69a99-21c8-4671-8703-7934162fcf1d}\\PropertyBag\" -Name \"ThisPCPolicy\" -Type String -Value \"Show\"\n}\n\n# Hide Pictures icon from This PC - The icon remains in personal folders and open/save dialogs\nFunction HidePicturesFromThisPC {\n\tWrite-Output \"Hiding Pictures icon from This PC...\"\n\tRemove-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{24ad3ad4-a569-4530-98e1-ab02f9417aa8}\" -Recurse -ErrorAction SilentlyContinue\n\tRemove-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{3ADD1653-EB32-4cb0-BBD7-DFA0ABB5ACCA}\" -Recurse -ErrorAction SilentlyContinue\n}\n\n# Show Pictures icon in This PC\nFunction ShowPicturesInThisPC {\n\tWrite-Output \"Showing Pictures icon in This PC...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{24ad3ad4-a569-4530-98e1-ab02f9417aa8}\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{24ad3ad4-a569-4530-98e1-ab02f9417aa8}\" | Out-Null\n\t}\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{3ADD1653-EB32-4cb0-BBD7-DFA0ABB5ACCA}\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{3ADD1653-EB32-4cb0-BBD7-DFA0ABB5ACCA}\" | Out-Null\n\t}\n}\n\n# Hide Pictures icon from Explorer namespace - Hides the icon also from personal folders and open/save dialogs\nFunction HidePicturesFromExplorer {\n\tWrite-Output \"Hiding Pictures icon from Explorer namespace...\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{0ddd015d-b06c-45d5-8c4c-f59713854639}\\PropertyBag\" -Name \"ThisPCPolicy\" -Type String -Value \"Hide\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{0ddd015d-b06c-45d5-8c4c-f59713854639}\\PropertyBag\" -Name \"ThisPCPolicy\" -Type String -Value \"Hide\"\n}\n\n# Show Pictures icon in Explorer namespace\nFunction ShowPicturesInExplorer {\n\tWrite-Output \"Showing Pictures icon in Explorer namespace...\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{0ddd015d-b06c-45d5-8c4c-f59713854639}\\PropertyBag\" -Name \"ThisPCPolicy\" -Type String -Value \"Show\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{0ddd015d-b06c-45d5-8c4c-f59713854639}\\PropertyBag\" -Name \"ThisPCPolicy\" -Type String -Value \"Show\"\n}\n\n# Hide Videos icon from This PC - The icon remains in personal folders and open/save dialogs\nFunction HideVideosFromThisPC {\n\tWrite-Output \"Hiding Videos icon from This PC...\"\n\tRemove-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}\" -Recurse -ErrorAction SilentlyContinue\n\tRemove-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{A0953C92-50DC-43bf-BE83-3742FED03C9C}\" -Recurse -ErrorAction SilentlyContinue\n}\n\n# Show Videos icon in This PC\nFunction ShowVideosInThisPC {\n\tWrite-Output \"Showing Videos icon in This PC...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}\" | Out-Null\n\t}\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{A0953C92-50DC-43bf-BE83-3742FED03C9C}\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{A0953C92-50DC-43bf-BE83-3742FED03C9C}\" | Out-Null\n\t}\n}\n\n# Hide Videos icon from Explorer namespace - Hides the icon also from personal folders and open/save dialogs\nFunction HideVideosFromExplorer {\n\tWrite-Output \"Hiding Videos icon from Explorer namespace...\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\\PropertyBag\" -Name \"ThisPCPolicy\" -Type String -Value \"Hide\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\\PropertyBag\" -Name \"ThisPCPolicy\" -Type String -Value \"Hide\"\n}\n\n# Show Videos icon in Explorer namespace\nFunction ShowVideosInExplorer {\n\tWrite-Output \"Showing Videos icon in Explorer namespace...\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\\PropertyBag\" -Name \"ThisPCPolicy\" -Type String -Value \"Show\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\\PropertyBag\" -Name \"ThisPCPolicy\" -Type String -Value \"Show\"\n}\n\n# Hide 3D Objects icon from This PC - The icon remains in personal folders and open/save dialogs\nFunction Hide3DObjectsFromThisPC {\n\tWrite-Output \"Hiding 3D Objects icon from This PC...\"\n\tRemove-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}\" -Recurse -ErrorAction SilentlyContinue\n}\n\n# Show 3D Objects icon in This PC\nFunction Show3DObjectsInThisPC {\n\tWrite-Output \"Showing 3D Objects icon in This PC...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MyComputer\\NameSpace\\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}\" | Out-Null\n\t}\n}\n\n# Hide 3D Objects icon from Explorer namespace - Hides the icon also from personal folders and open/save dialogs\nFunction Hide3DObjectsFromExplorer {\n\tWrite-Output \"Hiding 3D Objects icon from Explorer namespace...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\\PropertyBag\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\\PropertyBag\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\\PropertyBag\" -Name \"ThisPCPolicy\" -Type String -Value \"Hide\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\\PropertyBag\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\\PropertyBag\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\\PropertyBag\" -Name \"ThisPCPolicy\" -Type String -Value \"Hide\"\n}\n\n# Show 3D Objects icon in Explorer namespace\nFunction Show3DObjectsInExplorer {\n\tWrite-Output \"Showing 3D Objects icon in Explorer namespace...\"\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\\PropertyBag\" -Name \"ThisPCPolicy\" -ErrorAction SilentlyContinue\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FolderDescriptions\\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\\PropertyBag\" -Name \"ThisPCPolicy\" -ErrorAction SilentlyContinue\n}\n\n# Disable thumbnails, show only file extension icons\nFunction DisableThumbnails {\n\tWrite-Output \"Disabling thumbnails...\"\n\tSet-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" -Name \"IconsOnly\" -Type DWord -Value 1\n}\n\n# Enable thumbnails\nFunction EnableThumbnails {\n\tWrite-Output \"Enabling thumbnails...\"\n\tSet-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" -Name \"IconsOnly\" -Type DWord -Value 0\n}\n\n# Disable creation of Thumbs.db thumbnail cache files\nFunction DisableThumbsDB {\n\tWrite-Output \"Disabling creation of Thumbs.db...\"\n\tSet-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" -Name \"DisableThumbnailCache\" -Type DWord -Value 1\n\tSet-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" -Name \"DisableThumbsDBOnNetworkFolders\" -Type DWord -Value 1\n}\n\n# Enable creation of Thumbs.db thumbnail cache files\nFunction EnableThumbsDB {\n\tWrite-Output \"Enable creation of Thumbs.db...\"\n\tRemove-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" -Name \"DisableThumbnailCache\" -ErrorAction SilentlyContinue\n\tRemove-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" -Name \"DisableThumbsDBOnNetworkFolders\" -ErrorAction SilentlyContinue\n}\n\n\n\n##########\n# Application Tweaks\n##########\n\n# Disable OneDrive\nFunction DisableOneDrive {\n\tWrite-Output \"Disabling OneDrive...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\OneDrive\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\OneDrive\" | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\OneDrive\" -Name \"DisableFileSyncNGSC\" -Type DWord -Value 1\n}\n\n# Enable OneDrive\nFunction EnableOneDrive {\n\tWrite-Output \"Enabling OneDrive...\"\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\OneDrive\" -Name \"DisableFileSyncNGSC\" -ErrorAction SilentlyContinue\n}\n\n# Uninstall OneDrive - Not applicable to Server\nFunction UninstallOneDrive {\n\tWrite-Output \"Uninstalling OneDrive...\"\n\tStop-Process -Name \"OneDrive\" -ErrorAction SilentlyContinue\n\tStart-Sleep -s 2\n\t$onedrive = \"$env:SYSTEMROOT\\SysWOW64\\OneDriveSetup.exe\"\n\tIf (!(Test-Path $onedrive)) {\n\t\t$onedrive = \"$env:SYSTEMROOT\\System32\\OneDriveSetup.exe\"\n\t}\n\tStart-Process $onedrive \"/uninstall\" -NoNewWindow -Wait\n\tStart-Sleep -s 2\n\tStop-Process -Name \"explorer\" -ErrorAction SilentlyContinue\n\tStart-Sleep -s 2\n\tRemove-Item -Path \"$env:USERPROFILE\\OneDrive\" -Force -Recurse -ErrorAction SilentlyContinue\n\tRemove-Item -Path \"$env:LOCALAPPDATA\\Microsoft\\OneDrive\" -Force -Recurse -ErrorAction SilentlyContinue\n\tRemove-Item -Path \"$env:PROGRAMDATA\\Microsoft OneDrive\" -Force -Recurse -ErrorAction SilentlyContinue\n\tRemove-Item -Path \"$env:SYSTEMDRIVE\\OneDriveTemp\" -Force -Recurse -ErrorAction SilentlyContinue\n\tIf (!(Test-Path \"HKCR:\")) {\n\t\tNew-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null\n\t}\n\tRemove-Item -Path \"HKCR:\\CLSID\\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\" -Recurse -ErrorAction SilentlyContinue\n\tRemove-Item -Path \"HKCR:\\Wow6432Node\\CLSID\\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\" -Recurse -ErrorAction SilentlyContinue\n}\n\n# Install OneDrive - Not applicable to Server\nFunction InstallOneDrive {\n\tWrite-Output \"Installing OneDrive...\"\n\t$onedrive = \"$env:SYSTEMROOT\\SysWOW64\\OneDriveSetup.exe\"\n\tIf (!(Test-Path $onedrive)) {\n\t\t$onedrive = \"$env:SYSTEMROOT\\System32\\OneDriveSetup.exe\"\n\t}\n\tStart-Process $onedrive -NoNewWindow\n}\n\n# Uninstall default Microsoft applications\nFunction UninstallMsftBloat {\n\tWrite-Output \"Uninstalling default Microsoft applications...\"\n\tGet-AppxPackage \"Microsoft.3DBuilder\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.AppConnector\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.BingFinance\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.BingNews\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.BingSports\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.BingTranslator\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.BingWeather\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.CommsPhone\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.ConnectivityStore\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.GetHelp\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.Getstarted\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.Messaging\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.Microsoft3DViewer\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.MicrosoftOfficeHub\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.MicrosoftPowerBIForWindows\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.MicrosoftSolitaireCollection\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.MicrosoftStickyNotes\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.MinecraftUWP\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.MSPaint\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.NetworkSpeedTest\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.Office.OneNote\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.Office.Sway\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.OneConnect\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.People\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.Print3D\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.RemoteDesktop\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.SkypeApp\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.Wallet\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.WindowsAlarms\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.WindowsCamera\" | Remove-AppxPackage\n\tGet-AppxPackage \"microsoft.windowscommunicationsapps\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.WindowsFeedbackHub\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.WindowsMaps\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.WindowsPhone\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.Windows.Photos\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.WindowsSoundRecorder\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.ZuneMusic\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.ZuneVideo\" | Remove-AppxPackage\n}\n\n# Install default Microsoft applications\nFunction InstallMsftBloat {\n\tWrite-Output \"Installing default Microsoft applications...\"\n\tGet-AppxPackage -AllUsers \"Microsoft.3DBuilder\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.AppConnector\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.BingFinance\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.BingNews\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.BingSports\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.BingTranslator\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.BingWeather\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.CommsPhone\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.ConnectivityStore\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.GetHelp\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.Getstarted\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.Messaging\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.Microsoft3DViewer\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.MicrosoftOfficeHub\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.MicrosoftPowerBIForWindows\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.MicrosoftSolitaireCollection\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.MicrosoftStickyNotes\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.MinecraftUWP\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.MSPaint\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.NetworkSpeedTest\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.Office.OneNote\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.Office.Sway\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.OneConnect\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.People\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.Print3D\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.RemoteDesktop\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.SkypeApp\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.Wallet\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.WindowsAlarms\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.WindowsCamera\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.windowscommunicationsapps\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.WindowsFeedbackHub\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.WindowsMaps\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.WindowsPhone\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.Windows.Photos\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.WindowsSoundRecorder\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.ZuneMusic\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.ZuneVideo\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n}\n# In case you have removed them for good, you can try to restore the files using installation medium as follows\n# New-Item C:\\Mnt -Type Directory | Out-Null\n# dism /Mount-Image /ImageFile:D:\\sources\\install.wim /index:1 /ReadOnly /MountDir:C:\\Mnt\n# robocopy /S /SEC /R:0 \"C:\\Mnt\\Program Files\\WindowsApps\" \"C:\\Program Files\\WindowsApps\"\n# dism /Unmount-Image /Discard /MountDir:C:\\Mnt\n# Remove-Item -Path C:\\Mnt -Recurse\n\n# Uninstall default third party applications\nfunction UninstallThirdPartyBloat {\n\tWrite-Output \"Uninstalling default third party applications...\"\n\tGet-AppxPackage \"2414FC7A.Viber\" | Remove-AppxPackage\n\tGet-AppxPackage \"41038Axilesoft.ACGMediaPlayer\" | Remove-AppxPackage\n\tGet-AppxPackage \"46928bounde.EclipseManager\" | Remove-AppxPackage\n\tGet-AppxPackage \"4DF9E0F8.Netflix\" | Remove-AppxPackage\n\tGet-AppxPackage \"64885BlueEdge.OneCalendar\" | Remove-AppxPackage\n\tGet-AppxPackage \"7EE7776C.LinkedInforWindows\" | Remove-AppxPackage\n\tGet-AppxPackage \"828B5831.HiddenCityMysteryofShadows\" | Remove-AppxPackage\n\tGet-AppxPackage \"89006A2E.AutodeskSketchBook\" | Remove-AppxPackage\n\tGet-AppxPackage \"9E2F88E3.Twitter\" | Remove-AppxPackage\n\tGet-AppxPackage \"A278AB0D.DisneyMagicKingdoms\" | Remove-AppxPackage\n\tGet-AppxPackage \"A278AB0D.MarchofEmpires\" | Remove-AppxPackage\n\tGet-AppxPackage \"ActiproSoftwareLLC.562882FEEB491\" | Remove-AppxPackage\n\tGet-AppxPackage \"AdobeSystemsIncorporated.AdobePhotoshopExpress\" | Remove-AppxPackage\n\tGet-AppxPackage \"CAF9E577.Plex\" | Remove-AppxPackage\n\tGet-AppxPackage \"D52A8D61.FarmVille2CountryEscape\" | Remove-AppxPackage\n\tGet-AppxPackage \"D5EA27B7.Duolingo-LearnLanguagesforFree\" | Remove-AppxPackage\n\tGet-AppxPackage \"DB6EA5DB.CyberLinkMediaSuiteEssentials\" | Remove-AppxPackage\n\tGet-AppxPackage \"DolbyLaboratories.DolbyAccess\" | Remove-AppxPackage\n\tGet-AppxPackage \"Drawboard.DrawboardPDF\" | Remove-AppxPackage\n\tGet-AppxPackage \"Facebook.Facebook\" | Remove-AppxPackage\n\tGet-AppxPackage \"flaregamesGmbH.RoyalRevolt2\" | Remove-AppxPackage\n\tGet-AppxPackage \"GAMELOFTSA.Asphalt8Airborne\" | Remove-AppxPackage\n\tGet-AppxPackage \"KeeperSecurityInc.Keeper\" | Remove-AppxPackage\n\tGet-AppxPackage \"king.com.BubbleWitch3Saga\" | Remove-AppxPackage\n\tGet-AppxPackage \"king.com.CandyCrushSodaSaga\" | Remove-AppxPackage\n\tGet-AppxPackage \"PandoraMediaInc.29680B314EFC2\" | Remove-AppxPackage\n\tGet-AppxPackage \"SpotifyAB.SpotifyMusic\" | Remove-AppxPackage\n\tGet-AppxPackage \"WinZipComputing.WinZipUniversal\" | Remove-AppxPackage\n\tGet-AppxPackage \"XINGAG.XING\" | Remove-AppxPackage\n}\n\n# Install default third party applications\nFunction InstallThirdPartyBloat {\n\tWrite-Output \"Installing default third party applications...\"\n\tGet-AppxPackage -AllUsers \"2414FC7A.Viber\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"41038Axilesoft.ACGMediaPlayer\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"46928bounde.EclipseManager\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"4DF9E0F8.Netflix\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"64885BlueEdge.OneCalendar\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"7EE7776C.LinkedInforWindows\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"828B5831.HiddenCityMysteryofShadows\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"89006A2E.AutodeskSketchBook\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"9E2F88E3.Twitter\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"A278AB0D.DisneyMagicKingdoms\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"A278AB0D.MarchofEmpires\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"ActiproSoftwareLLC.562882FEEB491\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"AdobeSystemsIncorporated.AdobePhotoshopExpress\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"CAF9E577.Plex\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"D52A8D61.FarmVille2CountryEscape\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"D5EA27B7.Duolingo-LearnLanguagesforFree\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"DB6EA5DB.CyberLinkMediaSuiteEssentials\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"DolbyLaboratories.DolbyAccess\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Drawboard.DrawboardPDF\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Facebook.Facebook\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"flaregamesGmbH.RoyalRevolt2\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"GAMELOFTSA.Asphalt8Airborne\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"KeeperSecurityInc.Keeper\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"king.com.BubbleWitch3Saga\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"king.com.CandyCrushSodaSaga\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"PandoraMediaInc.29680B314EFC2\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"SpotifyAB.SpotifyMusic\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"WinZipComputing.WinZipUniversal\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"XINGAG.XING\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n}\n\n# Uninstall Windows Store\nFunction UninstallWindowsStore {\n\tWrite-Output \"Uninstalling Windows Store...\"\n\tGet-AppxPackage \"Microsoft.DesktopAppInstaller\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.WindowsStore\" | Remove-AppxPackage\n}\n\n# Install Windows Store\nFunction InstallWindowsStore {\n\tWrite-Output \"Installing Windows Store...\"\n\tGet-AppxPackage -AllUsers \"Microsoft.DesktopAppInstaller\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.WindowsStore\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n}\n\n# Disable Xbox features\nFunction DisableXboxFeatures {\n\tWrite-Output \"Disabling Xbox features...\"\n\tGet-AppxPackage \"Microsoft.XboxApp\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.XboxIdentityProvider\" | Remove-AppxPackage -ErrorAction SilentlyContinue\n\tGet-AppxPackage \"Microsoft.XboxSpeechToTextOverlay\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.XboxGameOverlay\" | Remove-AppxPackage\n\tGet-AppxPackage \"Microsoft.Xbox.TCUI\" | Remove-AppxPackage\n\tSet-ItemProperty -Path \"HKCU:\\System\\GameConfigStore\" -Name \"GameDVR_Enabled\" -Type DWord -Value 0\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\GameDVR\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\GameDVR\" | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\GameDVR\" -Name \"AllowGameDVR\" -Type DWord -Value 0\n}\n\n# Enable Xbox features\nFunction EnableXboxFeatures {\n\tWrite-Output \"Enabling Xbox features...\"\n\tGet-AppxPackage -AllUsers \"Microsoft.XboxApp\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.XboxIdentityProvider\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.XboxSpeechToTextOverlay\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.XboxGameOverlay\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tGet-AppxPackage -AllUsers \"Microsoft.Xbox.TCUI\" | ForEach {Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\\AppXManifest.xml\"}\n\tSet-ItemProperty -Path \"HKCU:\\System\\GameConfigStore\" -Name \"GameDVR_Enabled\" -Type DWord -Value 1\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\GameDVR\" -Name \"AllowGameDVR\" -ErrorAction SilentlyContinue\n}\n\n# Disable built-in Adobe Flash in IE and Edge\nFunction DisableAdobeFlash {\n\tWrite-Output \"Disabling built-in Adobe Flash in IE and Edge...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Internet Explorer\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Internet Explorer\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Internet Explorer\" -Name \"DisableFlashInIE\" -Type DWord -Value 1\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\MicrosoftEdge\\Addons\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\MicrosoftEdge\\Addons\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\MicrosoftEdge\\Addons\" -Name \"FlashPlayerEnabled\" -Type DWord -Value 0\n}\n\n# Enable built-in Adobe Flash in IE and Edge\nFunction EnableAdobeFlash {\n\tWrite-Output \"Enabling built-in Adobe Flash in IE and Edge...\"\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Internet Explorer\" -Name \"DisableFlashInIE\" -ErrorAction SilentlyContinue\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\MicrosoftEdge\\Addons\" -Name \"FlashPlayerEnabled\" -ErrorAction SilentlyContinue\n}\n\n# Uninstall Windows Media Player\nFunction UninstallMediaPlayer {\n\tWrite-Output \"Uninstalling Windows Media Player...\"\n\tDisable-WindowsOptionalFeature -Online -FeatureName \"WindowsMediaPlayer\" -NoRestart -WarningAction SilentlyContinue | Out-Null\n}\n\n# Install Windows Media Player\nFunction InstallMediaPlayer {\n\tWrite-Output \"Installing Windows Media Player...\"\n\tEnable-WindowsOptionalFeature -Online -FeatureName \"WindowsMediaPlayer\" -NoRestart -WarningAction SilentlyContinue | Out-Null\n}\n\n# Uninstall Internet Explorer\nFunction UninstallInternetExplorer {\n\tWrite-Output \"Uninstalling Internet Explorer...\"\n\tDisable-WindowsOptionalFeature -Online -FeatureName \"Internet-Explorer-Optional-$env:PROCESSOR_ARCHITECTURE\" -NoRestart -WarningAction SilentlyContinue | Out-Null\n}\n\n# Install Internet Explorer\nFunction InstallInternetExplorer {\n\tWrite-Output \"Installing Internet Explorer...\"\n\tEnable-WindowsOptionalFeature -Online -FeatureName \"Internet-Explorer-Optional-$env:PROCESSOR_ARCHITECTURE\" -NoRestart -WarningAction SilentlyContinue | Out-Null\n}\n\n# Uninstall Work Folders Client - Not applicable to Server\nFunction UninstallWorkFolders {\n\tWrite-Output \"Uninstalling Work Folders Client...\"\n\tDisable-WindowsOptionalFeature -Online -FeatureName \"WorkFolders-Client\" -NoRestart -WarningAction SilentlyContinue | Out-Null\n}\n\n# Install Work Folders Client - Not applicable to Server\nFunction InstallWorkFolders {\n\tWrite-Output \"Installing Work Folders Client...\"\n\tEnable-WindowsOptionalFeature -Online -FeatureName \"WorkFolders-Client\" -NoRestart -WarningAction SilentlyContinue | Out-Null\n}\n\n# Install Linux Subsystem - Applicable to 1607 or newer\nFunction InstallLinuxSubsystem {\n\tWrite-Output \"Installing Linux Subsystem...\"\n\tIf ([System.Environment]::OSVersion.Version.Build -eq 14393) {\n\t\t# 1607 needs developer mode to be enabled\n\t\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\AppModelUnlock\" -Name \"AllowDevelopmentWithoutDevLicense\" -Type DWord -Value 1\n\t\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\AppModelUnlock\" -Name \"AllowAllTrustedApps\" -Type DWord -Value 1\n\t}\n\tEnable-WindowsOptionalFeature -Online -FeatureName \"Microsoft-Windows-Subsystem-Linux\" -NoRestart -WarningAction SilentlyContinue | Out-Null\n}\n\n# Uninstall Linux Subsystem - Applicable to 1607 or newer\nFunction UninstallLinuxSubsystem {\n\tWrite-Output \"Uninstalling Linux Subsystem...\"\n\tIf ([System.Environment]::OSVersion.Version.Build -eq 14393) {\n\t\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\AppModelUnlock\" -Name \"AllowDevelopmentWithoutDevLicense\" -Type DWord -Value 0\n\t\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\AppModelUnlock\" -Name \"AllowAllTrustedApps\" -Type DWord -Value 0\n\t}\n\tDisable-WindowsOptionalFeature -Online -FeatureName \"Microsoft-Windows-Subsystem-Linux\" -NoRestart -WarningAction SilentlyContinue | Out-Null\n}\n\n# Install Hyper-V - Not applicable to Home\nFunction InstallHyperV {\n\tWrite-Output \"Installing Hyper-V...\"\n\tIf ((Get-WmiObject -Class \"Win32_OperatingSystem\").Caption -like \"*Server*\") {\n\t\tInstall-WindowsFeature -Name \"Hyper-V\" -IncludeManagementTools -WarningAction SilentlyContinue | Out-Null\n\t} Else {\n\t\tEnable-WindowsOptionalFeature -Online -FeatureName \"Microsoft-Hyper-V-All\" -NoRestart -WarningAction SilentlyContinue | Out-Null\n\t}\n}\n\n# Uninstall Hyper-V - Not applicable to Home\nFunction UninstallHyperV {\n\tWrite-Output \"Uninstalling Hyper-V...\"\n\tIf ((Get-WmiObject -Class \"Win32_OperatingSystem\").Caption -like \"*Server*\") {\n\t\tUninstall-WindowsFeature -Name \"Hyper-V\" -IncludeManagementTools -WarningAction SilentlyContinue | Out-Null\n\t} Else {\n\t\tDisable-WindowsOptionalFeature -Online -FeatureName \"Microsoft-Hyper-V-All\" -NoRestart -WarningAction SilentlyContinue | Out-Null\n\t}\n}\n\n# Set Photo Viewer association for bmp, gif, jpg, png and tif\nFunction SetPhotoViewerAssociation {\n\tWrite-Output \"Setting Photo Viewer association for bmp, gif, jpg, png and tif...\"\n\tIf (!(Test-Path \"HKCR:\")) {\n\t\tNew-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null\n\t}\n\tForEach ($type in @(\"Paint.Picture\", \"giffile\", \"jpegfile\", \"pngfile\")) {\n\t\tNew-Item -Path $(\"HKCR:\\$type\\shell\\open\") -Force | Out-Null\n\t\tNew-Item -Path $(\"HKCR:\\$type\\shell\\open\\command\") | Out-Null\n\t\tSet-ItemProperty -Path $(\"HKCR:\\$type\\shell\\open\") -Name \"MuiVerb\" -Type ExpandString -Value \"@%ProgramFiles%\\Windows Photo Viewer\\photoviewer.dll,-3043\"\n\t\tSet-ItemProperty -Path $(\"HKCR:\\$type\\shell\\open\\command\") -Name \"(Default)\" -Type ExpandString -Value \"%SystemRoot%\\System32\\rundll32.exe `\"%ProgramFiles%\\Windows Photo Viewer\\PhotoViewer.dll`\", ImageView_Fullscreen %1\"\n\t}\n}\n\n# Unset Photo Viewer association for bmp, gif, jpg, png and tif\nFunction UnsetPhotoViewerAssociation {\n\tWrite-Output \"Unsetting Photo Viewer association for bmp, gif, jpg, png and tif...\"\n\tIf (!(Test-Path \"HKCR:\")) {\n\t\tNew-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null\n\t}\n\tRemove-Item -Path \"HKCR:\\Paint.Picture\\shell\\open\" -Recurse -ErrorAction SilentlyContinue\n\tRemove-ItemProperty -Path \"HKCR:\\giffile\\shell\\open\" -Name \"MuiVerb\" -ErrorAction SilentlyContinue\n\tSet-ItemProperty -Path \"HKCR:\\giffile\\shell\\open\" -Name \"CommandId\" -Type String -Value \"IE.File\"\n\tSet-ItemProperty -Path \"HKCR:\\giffile\\shell\\open\\command\" -Name \"(Default)\" -Type String -Value \"`\"$env:SystemDrive\\Program Files\\Internet Explorer\\iexplore.exe`\" %1\"\n\tSet-ItemProperty -Path \"HKCR:\\giffile\\shell\\open\\command\" -Name \"DelegateExecute\" -Type String -Value \"{17FE9752-0B5A-4665-84CD-569794602F5C}\"\n\tRemove-Item -Path \"HKCR:\\jpegfile\\shell\\open\" -Recurse -ErrorAction SilentlyContinue\n\tRemove-Item -Path \"HKCR:\\pngfile\\shell\\open\" -Recurse -ErrorAction SilentlyContinue\n}\n\n# Add Photo Viewer to \"Open with...\"\nFunction AddPhotoViewerOpenWith {\n\tWrite-Output \"Adding Photo Viewer to `\"Open with...`\"\"\n\tIf (!(Test-Path \"HKCR:\")) {\n\t\tNew-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null\n\t}\n\tNew-Item -Path \"HKCR:\\Applications\\photoviewer.dll\\shell\\open\\command\" -Force | Out-Null\n\tNew-Item -Path \"HKCR:\\Applications\\photoviewer.dll\\shell\\open\\DropTarget\" -Force | Out-Null\n\tSet-ItemProperty -Path \"HKCR:\\Applications\\photoviewer.dll\\shell\\open\" -Name \"MuiVerb\" -Type String -Value \"@photoviewer.dll,-3043\"\n\tSet-ItemProperty -Path \"HKCR:\\Applications\\photoviewer.dll\\shell\\open\\command\" -Name \"(Default)\" -Type ExpandString -Value \"%SystemRoot%\\System32\\rundll32.exe `\"%ProgramFiles%\\Windows Photo Viewer\\PhotoViewer.dll`\", ImageView_Fullscreen %1\"\n\tSet-ItemProperty -Path \"HKCR:\\Applications\\photoviewer.dll\\shell\\open\\DropTarget\" -Name \"Clsid\" -Type String -Value \"{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}\"\n}\n\n# Remove Photo Viewer from \"Open with...\"\nFunction RemovePhotoViewerOpenWith {\n\tWrite-Output \"Removing Photo Viewer from `\"Open with...`\"\"\n\tIf (!(Test-Path \"HKCR:\")) {\n\t\tNew-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null\n\t}\n\tRemove-Item -Path \"HKCR:\\Applications\\photoviewer.dll\\shell\\open\" -Recurse -ErrorAction SilentlyContinue\n}\n\n# Uninstall Microsoft Print to PDF\nFunction UninstallPDFPrinter {\n\tWrite-Output \"Uninstalling Microsoft Print to PDF...\"\n\tDisable-WindowsOptionalFeature -Online -FeatureName \"Printing-PrintToPDFServices-Features\" -NoRestart -WarningAction SilentlyContinue | Out-Null\n}\n\n# Install Microsoft Print to PDF\nFunction InstallPDFPrinter {\n\tWrite-Output \"Installing Microsoft Print to PDF...\"\n\tEnable-WindowsOptionalFeature -Online -FeatureName \"Printing-PrintToPDFServices-Features\" -NoRestart -WarningAction SilentlyContinue | Out-Null\n}\n\n# Uninstall Microsoft XPS Document Writer\nFunction UninstallXPSPrinter {\n\tWrite-Output \"Uninstalling Microsoft XPS Document Writer...\"\n\tDisable-WindowsOptionalFeature -Online -FeatureName \"Printing-XPSServices-Features\" -NoRestart -WarningAction SilentlyContinue | Out-Null\n}\n\n# Install Microsoft XPS Document Writer\nFunction InstallXPSPrinter {\n\tWrite-Output \"Installing Microsoft XPS Document Writer...\"\n\tEnable-WindowsOptionalFeature -Online -FeatureName \"Printing-XPSServices-Features\" -NoRestart -WarningAction SilentlyContinue | Out-Null\n}\n\n# Remove Default Fax Printer\nFunction RemoveFaxPrinter {\n\tWrite-Output \"Removing Default Fax Printer...\"\n\tRemove-Printer -Name \"Fax\" -ErrorAction SilentlyContinue\n}\n\n# Add Default Fax Printer\nFunction AddFaxPrinter {\n\tWrite-Output \"Adding Default Fax Printer...\"\n\tAdd-Printer -Name \"Fax\" -DriverName \"Microsoft Shared Fax Driver\" -PortName \"SHRFAX:\" -ErrorAction SilentlyContinue\n}\n\n\n\n##########\n# Server specific Tweaks\n##########\n\n# Hide Server Manager after login\nFunction HideServerManagerOnLogin {\n\tWrite-Output \"Hiding Server Manager after login...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Server\\ServerManager\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Server\\ServerManager\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Server\\ServerManager\" -Name \"DoNotOpenAtLogon\" -Type DWord -Value 1\n}\n\n# Hide Server Manager after login\nFunction ShowServerManagerOnLogin {\n\tWrite-Output \"Showing Server Manager after login...\"\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows\\Server\\ServerManager\" -Name \"DoNotOpenAtLogon\" -ErrorAction SilentlyContinue\n}\n\n# Disable Shutdown Event Tracker\nFunction DisableShutdownTracker {\n\tWrite-Output \"Disabling Shutdown Event Tracker...\"\n\tIf (!(Test-Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Reliability\")) {\n\t\tNew-Item -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Reliability\" -Force | Out-Null\n\t}\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Reliability\" -Name \"ShutdownReasonOn\" -Type DWord -Value 0\n}\n\n# Enable Shutdown Event Tracker\nFunction EnableShutdownTracker {\n\tWrite-Output \"Enabling Shutdown Event Tracker...\"\n\tRemove-ItemProperty -Path \"HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Reliability\" -Name \"ShutdownReasonOn\" -ErrorAction SilentlyContinue\n}\n\n# Disable password complexity and maximum age requirements\nFunction DisablePasswordPolicy {\n\tWrite-Output \"Disabling password complexity and maximum age requirements...\"\n\t$tmpfile = New-TemporaryFile\n\tsecedit /export /cfg $tmpfile /quiet\n\t(Get-Content $tmpfile).Replace(\"PasswordComplexity = 1\", \"PasswordComplexity = 0\").Replace(\"MaximumPasswordAge = 42\", \"MaximumPasswordAge = -1\") | Out-File $tmpfile\n\tsecedit /configure /db \"$env:SYSTEMROOT\\security\\database\\local.sdb\" /cfg $tmpfile /areas SECURITYPOLICY | Out-Null\n\tRemove-Item -Path $tmpfile\n}\n\n# Enable password complexity and maximum age requirements\nFunction EnablePasswordPolicy {\n\tWrite-Output \"Enabling password complexity and maximum age requirements...\"\n\t$tmpfile = New-TemporaryFile\n\tsecedit /export /cfg $tmpfile /quiet\n\t(Get-Content $tmpfile).Replace(\"PasswordComplexity = 0\", \"PasswordComplexity = 1\").Replace(\"MaximumPasswordAge = -1\", \"MaximumPasswordAge = 42\") | Out-File $tmpfile\n\tsecedit /configure /db \"$env:SYSTEMROOT\\security\\database\\local.sdb\" /cfg $tmpfile /areas SECURITYPOLICY | Out-Null\n\tRemove-Item -Path $tmpfile\n}\n\n# Disable Ctrl+Alt+Del requirement before login\nFunction DisableCtrlAltDelLogin {\n\tWrite-Output \"Disabling Ctrl+Alt+Del requirement before login...\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\" -Name \"DisableCAD\" -Type DWord -Value 1\n}\n\n# Enable Ctrl+Alt+Del requirement before login\nFunction EnableCtrlAltDelLogin {\n\tWrite-Output \"Enabling Ctrl+Alt+Del requirement before login...\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\" -Name \"DisableCAD\" -Type DWord -Value 0\n}\n\n# Disable Internet Explorer Enhanced Security Configuration (IE ESC)\nFunction DisableIEEnhancedSecurity {\n\tWrite-Output \"Disabling Internet Explorer Enhanced Security Configuration (IE ESC)...\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Active Setup\\Installed Components\\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}\" -Name \"IsInstalled\" -Type DWord -Value 0\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Active Setup\\Installed Components\\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}\" -Name \"IsInstalled\" -Type DWord -Value 0\n}\n\n# Enable Internet Explorer Enhanced Security Configuration (IE ESC)\nFunction EnableIEEnhancedSecurity {\n\tWrite-Output \"Enabling Internet Explorer Enhanced Security Configuration (IE ESC)...\"\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Active Setup\\Installed Components\\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}\" -Name \"IsInstalled\" -Type DWord -Value 1\n\tSet-ItemProperty -Path \"HKLM:\\SOFTWARE\\Microsoft\\Active Setup\\Installed Components\\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}\" -Name \"IsInstalled\" -Type DWord -Value 1\n}\n\n# Enable Audio\nFunction EnableAudio {\n\tWrite-Output \"Enabling Audio...\"\n\tSet-Service \"Audiosrv\" -StartupType Automatic\n\tStart-Service \"Audiosrv\" -WarningAction SilentlyContinue\n}\n\n# Disable Audio\nFunction DisableAudio {\n\tWrite-Output \"Disabling Audio...\"\n\tStop-Service \"Audiosrv\" -WarningAction SilentlyContinue\n\tSet-Service \"Audiosrv\" -StartupType Manual\n}\n\n\n\n##########\n# Unpinning\n##########\n\n# Unpin all Start Menu tiles - Note: This function has no counterpart. You have to pin the tiles back manually.\nFunction UnpinStartMenuTiles {\n\tWrite-Output \"Unpinning all Start Menu tiles...\"\n\tIf ([System.Environment]::OSVersion.Version.Build -ge 15063 -And [System.Environment]::OSVersion.Version.Build -le 16299) {\n\t\tGet-ChildItem -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\CloudStore\\Store\\Cache\\DefaultAccount\" -Include \"*.group\" -Recurse | ForEach-Object {\n\t\t\t$data = (Get-ItemProperty -Path \"$($_.PsPath)\\Current\" -Name \"Data\").Data -Join \",\"\n\t\t\t$data = $data.Substring(0, $data.IndexOf(\",0,202,30\") + 9) + \",0,202,80,0,0\"\n\t\t\tSet-ItemProperty -Path \"$($_.PsPath)\\Current\" -Name \"Data\" -Type Binary -Value $data.Split(\",\")\n\t\t}\n\t} ElseIf ([System.Environment]::OSVersion.Version.Build -eq 17133) {\n\t\t$key = Get-ChildItem -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\CloudStore\\Store\\Cache\\DefaultAccount\" -Recurse | Where-Object { $_ -like \"*start.tilegrid`$windows.data.curatedtilecollection.tilecollection\\Current\" }\n\t\t$data = (Get-ItemProperty -Path $key.PSPath -Name \"Data\").Data[0..25] + ([byte[]](202,50,0,226,44,1,1,0,0))\n\t\tSet-ItemProperty -Path $key.PSPath -Name \"Data\" -Type Binary -Value $data\n\t}\n}\n\n# Unpin all Taskbar icons - Note: This function has no counterpart. You have to pin the icons back manually.\nFunction UnpinTaskbarIcons {\n\tWrite-Output \"Unpinning all Taskbar icons...\"\n\tSet-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Taskband\" -Name \"Favorites\" -Type Binary -Value ([byte[]](255))\n\tRemove-ItemProperty -Path \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Taskband\" -Name \"FavoritesResolve\" -ErrorAction SilentlyContinue\n}\n\n\n\n##########\n# Auxiliary Functions\n##########\n\n# Relaunch the script with administrator privileges\nFunction RequireAdmin {\n\tIf (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]\"Administrator\")) {\n\t\tStart-Process powershell.exe \"-NoProfile -ExecutionPolicy Bypass -File `\"$PSCommandPath`\" $PSCommandArgs\" -WorkingDirectory $pwd -Verb RunAs\n\t\tExit\n\t}\n}\n\n# Wait for key press\nFunction WaitForKey {\n\tWrite-Output \"`nPress any key to continue...\"\n\t[Console]::ReadKey($true) | Out-Null\n}\n\n# Restart computer\nFunction Restart {\n\tWrite-Output \"Restarting...\"\n\tRestart-Computer\n}\n\n\n\n##########\n# Parse parameters and apply tweaks\n##########\n\n# Normalize path to preset file\n$preset = \"\"\n$PSCommandArgs = $args\nIf ($args -And $args[0].ToLower() -eq \"-preset\") {\n\t$preset = Resolve-Path $($args | Select-Object -Skip 1)\n\t$PSCommandArgs = \"-preset `\"$preset`\"\"\n}\n\n# Load function names from command line arguments or a preset file\nIf ($args) {\n\t$tweaks = $args\n\tIf ($preset) {\n\t\t$tweaks = Get-Content $preset -ErrorAction Stop | ForEach { $_.Trim() } | Where { $_ -ne \"\" -and $_[0] -ne \"#\" }\n\t}\n}\n\n# Call the desired tweak functions\n$tweaks | ForEach { Invoke-Expression $_ }", "creation_timestamp": "2026-07-27T08:23:48.499763Z"}