Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2016
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ##########
  2. # Tweaked Win10 Initial Setup Script
  3. # Primary Author: Disassembler <disassembler@dasm.cz>
  4. # Original Version: 1.4, 2016-01-16
  5. # Tweaked based on personal preferences for @alirobe 2016-03-23 - v1.4.1
  6. # NOTE: MAKE SURE YOU READ THIS SCRIPT CAREFULLY BEFORE RUNNING IT + ADJUST COMMENTING AS APPROPRIATE
  7. #       This script will reboot your machine when completed.
  8. ##########
  9.  
  10. # Ask for elevated permissions if required
  11. If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]"Administrator")) {
  12.     Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs
  13.     Exit
  14. }
  15.  
  16.  
  17.  
  18. ##########
  19. # Privacy Settings
  20. ##########
  21.  
  22. # Disable Telemetry
  23. Write-Host "Disabling Telemetry..."
  24. Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0
  25.  
  26. # Enable Telemetry
  27. # Remove-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\DataCollection" -Name "AllowTelemetry"
  28.  
  29. # Disable Wi-Fi Sense
  30. Write-Host "Disabling Wi-Fi Sense..."
  31. If (!(Test-Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting")) {
  32.     New-Item -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Force | Out-Null
  33. }
  34. Set-ItemProperty -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Name "Value" -Type DWord -Value 0
  35. Set-ItemProperty -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" -Name "Value" -Type DWord -Value 0
  36.  
  37. # Enable Wi-Fi Sense
  38. # Set-ItemProperty -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Name "Value" -Type DWord -Value 1
  39. # Set-ItemProperty -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" -Name "Value" -Type DWord -Value 1
  40.  
  41. # Disable SmartScreen Filter
  42. # Write-Host "Disabling SmartScreen Filter..."
  43. # Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer" -Name "SmartScreenEnabled" -Type String -Value "Off"
  44. # Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\AppHost" -Name "EnableWebContentEvaluation" -Type DWord -Value 0
  45.  
  46. # Enable SmartScreen Filter
  47. # Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer" -Name "SmartScreenEnabled" -Type String -Value "RequireAdmin"
  48. # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\AppHost" -Name "EnableWebContentEvaluation"
  49.  
  50. # Disable Bing Search in Start Menu
  51. Write-Host "Disabling Bing Search in Start Menu..."
  52. Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" -Name "BingSearchEnabled" -Type DWord -Value 0
  53.  
  54. # Enable Bing Search in Start Menu
  55. # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" -Name "BingSearchEnabled"
  56.  
  57. # Disable Location Tracking
  58. Write-Host "Disabling Location Tracking..."
  59. Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" -Name "SensorPermissionState" -Type DWord -Value 0
  60. Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Services\lfsvc\Service\Configuration" -Name "Status" -Type DWord -Value 0
  61.  
  62. # Enable Location Tracking
  63. # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" -Name "SensorPermissionState" -Type DWord -Value 1
  64. # Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Services\lfsvc\Service\Configuration" -Name "Status" -Type DWord -Value 1
  65.  
  66. # Disable Feedback
  67. Write-Host "Disabling Feedback..."
  68. If (!(Test-Path "HKCU:\Software\Microsoft\Siuf\Rules")) {
  69.     New-Item -Path "HKCU:\Software\Microsoft\Siuf\Rules" -Force | Out-Null
  70. }
  71. Set-ItemProperty -Path "HKCU:\Software\Microsoft\Siuf\Rules" -Name "NumberOfSIUFInPeriod" -Type DWord -Value 0
  72.  
  73. # Enable Feedback
  74. # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Siuf\Rules" -Name "NumberOfSIUFInPeriod"
  75.  
  76. # Disable Advertising ID
  77. Write-Host "Disabling Advertising ID..."
  78. If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo")) {
  79.     New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" | Out-Null
  80. }
  81. Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" -Name "Enabled" -Type DWord -Value 0
  82.  
  83. # Enable Advertising ID
  84. # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" -Name "Enabled"
  85.  
  86. # Disable Cortana
  87. Write-Host "Disabling Cortana..."
  88. If (!(Test-Path "HKCU:\Software\Microsoft\Personalization\Settings")) {
  89.     New-Item -Path "HKCU:\Software\Microsoft\Personalization\Settings" -Force | Out-Null
  90. }
  91. Set-ItemProperty -Path "HKCU:\Software\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy" -Type DWord -Value 0
  92. If (!(Test-Path "HKCU:\Software\Microsoft\InputPersonalization")) {
  93.     New-Item -Path "HKCU:\Software\Microsoft\InputPersonalization" -Force | Out-Null
  94. }
  95. Set-ItemProperty -Path "HKCU:\Software\Microsoft\InputPersonalization" -Name "RestrictImplicitTextCollection" -Type DWord -Value 1
  96. Set-ItemProperty -Path "HKCU:\Software\Microsoft\InputPersonalization" -Name "RestrictImplicitInkCollection" -Type DWord -Value 1
  97. If (!(Test-Path "HKCU:\Software\Microsoft\InputPersonalization\TrainedDataStore")) {
  98.     New-Item -Path "HKCU:\Software\Microsoft\InputPersonalization\TrainedDataStore" -Force | Out-Null
  99. }
  100. Set-ItemProperty -Path "HKCU:\Software\Microsoft\InputPersonalization\TrainedDataStore" -Name "HarvestContacts" -Type DWord -Value 0
  101.  
  102. # Enable Cortana
  103. # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy"
  104. # Set-ItemProperty -Path "HKCU:\Software\Microsoft\InputPersonalization" -Name "RestrictImplicitTextCollection" -Type DWord -Value 0
  105. # Set-ItemProperty -Path "HKCU:\Software\Microsoft\InputPersonalization" -Name "RestrictImplicitInkCollection" -Type DWord -Value 0
  106. # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\InputPersonalization\TrainedDataStore" -Name "HarvestContacts"
  107.  
  108. # Restrict Windows Update P2P only to local network
  109. Write-Host "Restricting Windows Update P2P only to local network..."
  110. Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 1
  111. If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization")) {
  112.     New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization" | Out-Null
  113. }
  114. Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization" -Name "SystemSettingsDownloadMode" -Type DWord -Value 3
  115.  
  116. # Unrestrict Windows Update P2P
  117. # Remove-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode"
  118. # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization" -Name "SystemSettingsDownloadMode"
  119.  
  120. # Remove AutoLogger file and restrict directory
  121. Write-Host "Removing AutoLogger file and restricting directory..."
  122. $autoLoggerDir = "$env:PROGRAMDATA\Microsoft\Diagnosis\ETLLogs\AutoLogger"
  123. If (Test-Path "$autoLoggerDir\AutoLogger-Diagtrack-Listener.etl") {
  124.     Remove-Item "$autoLoggerDir\AutoLogger-Diagtrack-Listener.etl"
  125. }
  126. icacls $autoLoggerDir /deny SYSTEM:`(OI`)`(CI`)F | Out-Null
  127.  
  128. # Unrestrict AutoLogger directory
  129. # $autoLoggerDir = "$env:PROGRAMDATA\Microsoft\Diagnosis\ETLLogs\AutoLogger"
  130. # icacls $autoLoggerDir /grant:r SYSTEM:`(OI`)`(CI`)F | Out-Null
  131.  
  132. # Stop and disable Diagnostics Tracking Service
  133. Write-Host "Stopping and disabling Diagnostics Tracking Service..."
  134. Stop-Service "DiagTrack"
  135. Set-Service "DiagTrack" -StartupType Disabled
  136.  
  137. # Enable and start Diagnostics Tracking Service
  138. # Set-Service "DiagTrack" -StartupType Automatic
  139. # Start-Service "DiagTrack"
  140.  
  141. # Stop and disable WAP Push Service
  142. Write-Host "Stopping and disabling WAP Push Service..."
  143. Stop-Service "dmwappushservice"
  144. Set-Service "dmwappushservice" -StartupType Disabled
  145.  
  146. # Enable and start WAP Push Service
  147. # Set-Service "dmwappushservice" -StartupType Automatic
  148. # Start-Service "dmwappushservice"
  149. # Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\dmwappushservice" -Name "DelayedAutoStart" -Type DWord -Value 1
  150.  
  151.  
  152.  
  153. ##########
  154. # Service Tweaks
  155. ##########
  156.  
  157. # Lower UAC level
  158. # Write-Host "Lowering UAC level..."
  159. # Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ConsentPromptBehaviorAdmin" -Type DWord -Value 0
  160. # Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "PromptOnSecureDesktop" -Type DWord -Value 0
  161.  
  162. # Raise UAC level
  163. # Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ConsentPromptBehaviorAdmin" -Type DWord -Value 5
  164. # Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "PromptOnSecureDesktop" -Type DWord -Value 1
  165.  
  166. # Enable sharing mapped drives between users
  167. # Write-Host "Enabling sharing mapped drives between users..."
  168. # Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "EnableLinkedConnections" -Type DWord -Value 1
  169.  
  170. # Disable sharing mapped drives between users
  171. # Remove-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "EnableLinkedConnections"
  172.  
  173. # Disable Firewall
  174. # Write-Host "Disabling Firewall..."
  175. # Set-NetFirewallProfile -Profile * -Enabled False
  176.  
  177. # Enable Firewall
  178. # Set-NetFirewallProfile -Profile * -Enabled True
  179.  
  180. # Disable Windows Defender
  181. # Write-Host "Disabling Windows Defender..."
  182. # Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows Defender" -Name "DisableAntiSpyware" -Type DWord -Value 1
  183.  
  184. # Enable Windows Defender
  185. # Remove-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows Defender" -Name "DisableAntiSpyware"
  186.  
  187. # Disable Windows Update automatic restart
  188. Write-Host "Disabling Windows Update automatic restart..."
  189. Set-ItemProperty -Path "HKLM:\Software\Microsoft\WindowsUpdate\UX\Settings" -Name "UxOption" -Type DWord -Value 1
  190.  
  191. # Enable Windows Update automatic restart
  192. # Set-ItemProperty -Path "HKLM:\Software\Microsoft\WindowsUpdate\UX\Settings" -Name "UxOption" -Type DWord -Value 0
  193.  
  194. # Stop and disable Home Groups services
  195. Write-Host "Stopping and disabling Home Groups services..."
  196. Stop-Service "HomeGroupListener"
  197. Set-Service "HomeGroupListener" -StartupType Disabled
  198. Stop-Service "HomeGroupProvider"
  199. Set-Service "HomeGroupProvider" -StartupType Disabled
  200.  
  201. # Enable and start Home Groups services
  202. # Set-Service "HomeGroupListener" -StartupType Manual
  203. # Set-Service "HomeGroupProvider" -StartupType Manual
  204. # Start-Service "HomeGroupProvider"
  205.  
  206. # Disable Remote Assistance
  207. # Write-Host "Disabling Remote Assistance..."
  208. # Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Remote Assistance" -Name "fAllowToGetHelp" -Type DWord -Value 0
  209.  
  210. # Enable Remote Assistance
  211. # Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Remote Assistance" -Name "fAllowToGetHelp" -Type DWord -Value 1
  212.  
  213. # Enable Remote Desktop w/o Network Level Authentication
  214. # Write-Host "Enabling Remote Desktop w/o Network Level Authentication..."
  215. # Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server" -Name "fDenyTSConnections" -Type DWord -Value 0
  216. # Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name "UserAuthentication" -Type DWord -Value 0
  217.  
  218. # Disable Remote Desktop
  219. # Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server" -Name "fDenyTSConnections" -Type DWord -Value 1
  220. # Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name "UserAuthentication" -Type DWord -Value 1
  221.  
  222.  
  223.  
  224. ##########
  225. # UI Tweaks
  226. ##########
  227.  
  228. # Disable Action Center
  229. # Write-Host "Disabling Action Center..."
  230. # If (!(Test-Path "HKCU:\Software\Policies\Microsoft\Windows\Explorer")) {
  231. #   New-Item -Path "HKCU:\Software\Policies\Microsoft\Windows\Explorer" | Out-Null
  232. # }
  233. # Set-ItemProperty -Path "HKCU:\Software\Policies\Microsoft\Windows\Explorer" -Name "DisableNotificationCenter" -Type DWord -Value 1
  234. # Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications" -Name "ToastEnabled" -Type DWord -Value 0
  235.  
  236. # Enable Action Center
  237. # Remove-ItemProperty -Path "HKCU:\Software\Policies\Microsoft\Windows\Explorer" -Name "DisableNotificationCenter"
  238. # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications" -Name "ToastEnabled"
  239.  
  240. # Disable Lock screen
  241. Write-Host "Disabling Lock screen..."
  242. If (!(Test-Path "HKLM:\Software\Policies\Microsoft\Windows\Personalization")) {
  243.   New-Item -Path "HKLM:\Software\Policies\Microsoft\Windows\Personalization" | Out-Null
  244. }
  245. Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\Personalization" -Name "NoLockScreen" -Type DWord -Value 1
  246.  
  247. # Enable Lock screen
  248. # Remove-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\Personalization" -Name "NoLockScreen"
  249.  
  250. # Disable Autoplay
  251. # Write-Host "Disabling Autoplay..."
  252. # Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers" -Name "DisableAutoplay" -Type DWord -Value 1
  253.  
  254. # Enable Autoplay
  255. # Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers" -Name "DisableAutoplay" -Type DWord -Value 0
  256.  
  257. # Disable Autorun for all drives
  258. # Write-Host "Disabling Autorun for all drives..."
  259. # If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer")) {
  260. #   New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" | Out-Null
  261. #}
  262. # Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "NoDriveTypeAutoRun" -Type DWord -Value 255
  263.  
  264. # Enable Autorun
  265. # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "NoDriveTypeAutoRun"
  266.  
  267. Disable Sticky keys prompt
  268. Write-Host "Disabling Sticky keys prompt..."
  269. Set-ItemProperty -Path "HKCU:\Control Panel\Accessibility\StickyKeys" -Name "Flags" -Type String -Value "506"
  270.  
  271. # Enable Sticky keys prompt
  272. # Set-ItemProperty -Path "HKCU:\Control Panel\Accessibility\StickyKeys" -Name "Flags" -Type String -Value "510"
  273.  
  274. # Hide Search button / box
  275. Write-Host "Hiding Search Box / Button..."
  276. Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" -Name "SearchboxTaskbarMode" -Type DWord -Value 0
  277.  
  278. # Show Search button / box
  279. # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" -Name "SearchboxTaskbarMode"
  280.  
  281. # Hide Task View button
  282. # Write-Host "Hiding Task View button..."
  283. # Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowTaskViewButton" -Type DWord -Value 0
  284.  
  285. # Show Task View button
  286. # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowTaskViewButton"
  287.  
  288. # Show small icons in taskbar
  289. # Write-Host "Showing small icons in taskbar..."
  290. # Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarSmallIcons" -Type DWord -Value 1
  291.  
  292. # Show large icons in taskbar
  293. # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarSmallIcons"
  294.  
  295. # Show titles in taskbar
  296. # Write-Host "Showing titles in taskbar..."
  297. # Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarGlomLevel" -Type DWord -Value 1
  298.  
  299. # Hide titles in taskbar
  300. # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarGlomLevel"
  301.  
  302. # Show all tray icons
  303. # Write-Host "Showing all tray icons..."
  304. # Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer" -Name "EnableAutoTray" -Type DWord -Value 0
  305.  
  306. # Hide tray icons as needed
  307. # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer" -Name "EnableAutoTray"
  308.  
  309. # Show known file extensions
  310. Write-Host "Showing known file extensions..."
  311. Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -Type DWord -Value 0
  312.  
  313. # Hide known file extensions
  314. # Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -Type DWord -Value 1
  315.  
  316. # Show hidden files
  317. Write-Host "Showing hidden files..."
  318. Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "Hidden" -Type DWord -Value 1
  319.  
  320. # Hide hidden files
  321. # Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "Hidden" -Type DWord -Value 2
  322.  
  323. # Change default Explorer view to "Computer"
  324. Write-Host "Changing default Explorer view to `"Computer`"..."
  325. Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "LaunchTo" -Type DWord -Value 1
  326.  
  327. # Change default Explorer view to "Quick Access"
  328. # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "LaunchTo"
  329.  
  330. # Show Computer shortcut on desktop
  331. # Write-Host "Showing Computer shortcut on desktop..."
  332. # If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu")) {
  333. #   New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" | Out-Null
  334. # }
  335. # Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" -Name "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" -Type DWord -Value 0
  336. # Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" -Name "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" -Type DWord -Value 0
  337.  
  338. # Hide Computer shortcut from desktop
  339. # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" -Name "{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
  340. # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" -Name "{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
  341.  
  342. # Remove Desktop icon from computer namespace
  343. # Write-Host "Removing Desktop icon from computer namespace..."
  344. # Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}" -Recurse -ErrorAction SilentlyContinue
  345.  
  346. # Add Desktop icon to computer namespace
  347. # New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}"
  348.  
  349. # Remove Documents icon from computer namespace
  350. # Write-Host "Removing Documents icon from computer namespace..."
  351. # Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{d3162b92-9365-467a-956b-92703aca08af}" -Recurse -ErrorAction SilentlyContinue
  352. # Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A8CDFF1C-4878-43be-B5FD-F8091C1C60D0}" -Recurse -ErrorAction SilentlyContinue
  353.  
  354. # Add Documents icon to computer namespace
  355. # New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{d3162b92-9365-467a-956b-92703aca08af}"
  356. # New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A8CDFF1C-4878-43be-B5FD-F8091C1C60D0}"
  357.  
  358. # Remove Downloads icon from computer namespace
  359. # Write-Host "Removing Downloads icon from computer namespace..."
  360. # Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{088e3905-0323-4b02-9826-5d99428e115f}" -Recurse -ErrorAction SilentlyContinue
  361. # Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{374DE290-123F-4565-9164-39C4925E467B}" -Recurse -ErrorAction SilentlyContinue
  362.  
  363. # Add Downloads icon to computer namespace
  364. # New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{088e3905-0323-4b02-9826-5d99428e115f}"
  365. # New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{374DE290-123F-4565-9164-39C4925E467B}"
  366.  
  367. # Remove Music icon from computer namespace
  368. # Write-Host "Removing Music icon from computer namespace..."
  369. # Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3dfdf296-dbec-4fb4-81d1-6a3438bcf4de}" -Recurse -ErrorAction SilentlyContinue
  370. # Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{1CF1260C-4DD0-4ebb-811F-33C572699FDE}" -Recurse -ErrorAction SilentlyContinue
  371.  
  372. # Add Music icon to computer namespace
  373. # New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3dfdf296-dbec-4fb4-81d1-6a3438bcf4de}"
  374. # New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{1CF1260C-4DD0-4ebb-811F-33C572699FDE}"
  375.  
  376. # Remove Pictures icon from computer namespace
  377. Write-Host "Removing Pictures icon from computer namespace..."
  378. Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{24ad3ad4-a569-4530-98e1-ab02f9417aa8}" -Recurse -ErrorAction SilentlyContinue
  379. Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3ADD1653-EB32-4cb0-BBD7-DFA0ABB5ACCA}" -Recurse -ErrorAction SilentlyContinue
  380.  
  381. # Add Pictures icon to computer namespace
  382. # New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{24ad3ad4-a569-4530-98e1-ab02f9417aa8}"
  383. # New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3ADD1653-EB32-4cb0-BBD7-DFA0ABB5ACCA}"
  384.  
  385. # Remove Videos icon from computer namespace
  386. Write-Host "Removing Videos icon from computer namespace..."
  387. Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}" -Recurse -ErrorAction SilentlyContinue
  388. Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A0953C92-50DC-43bf-BE83-3742FED03C9C}" -Recurse -ErrorAction SilentlyContinue
  389.  
  390. # Add Videos icon to computer namespace
  391. # New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}"
  392. # New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A0953C92-50DC-43bf-BE83-3742FED03C9C}"
  393.  
  394. ## Add secondary en-US keyboard
  395. #Write-Host "Adding secondary en-US keyboard..."
  396. #$langs = Get-WinUserLanguageList
  397. #$langs.Add("en-US")
  398. #Set-WinUserLanguageList $langs -Force
  399.  
  400. # Remove secondary en-US keyboard
  401. # $langs = Get-WinUserLanguageList
  402. # Set-WinUserLanguageList ($langs | ? {$_.LanguageTag -ne "en-US"}) -Force
  403.  
  404.  
  405.  
  406. ##########
  407. # Remove unwanted applications
  408. ##########
  409.  
  410. # Disable OneDrive
  411. # Write-Host "Disabling OneDrive..."
  412. # If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive")) {
  413. #     New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" | Out-Null
  414. # }
  415. # Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" -Name "DisableFileSyncNGSC" -Type DWord -Value 1
  416.  
  417. # Enable OneDrive
  418. # Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" -Name "DisableFileSyncNGSC"
  419.  
  420. # Uninstall OneDrive
  421. # Write-Host "Uninstalling OneDrive..."
  422. # Stop-Process -Name OneDrive -ErrorAction SilentlyContinue
  423. # Start-Sleep -s 3
  424. # $onedrive = "$env:SYSTEMROOT\SysWOW64\OneDriveSetup.exe"
  425. # If (!(Test-Path $onedrive)) {
  426. #     $onedrive = "$env:SYSTEMROOT\System32\OneDriveSetup.exe"
  427. # }
  428. # Start-Process $onedrive "/uninstall" -NoNewWindow -Wait
  429. # Start-Sleep -s 3
  430. # Stop-Process -Name explorer -ErrorAction SilentlyContinue
  431. # Start-Sleep -s 3
  432. # Remove-Item "$env:USERPROFILE\OneDrive" -Force -Recurse -ErrorAction SilentlyContinue
  433. # Remove-Item "$env:LOCALAPPDATA\Microsoft\OneDrive" -Force -Recurse -ErrorAction SilentlyContinue
  434. # Remove-Item "$env:PROGRAMDATA\Microsoft OneDrive" -Force -Recurse -ErrorAction SilentlyContinue
  435. # If (Test-Path "$env:SYSTEMDRIVE\OneDriveTemp") {
  436. #     Remove-Item "$env:SYSTEMDRIVE\OneDriveTemp" -Force -Recurse -ErrorAction SilentlyContinue
  437. # }
  438. # If (!(Test-Path "HKCR:")) {
  439. #     New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null
  440. # }
  441. # Remove-Item -Path "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" -Recurse -ErrorAction SilentlyContinue
  442. # Remove-Item -Path "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" -Recurse -ErrorAction SilentlyContinue
  443.  
  444. # Install OneDrive
  445. # $onedrive = "$env:SYSTEMROOT\SysWOW64\OneDriveSetup.exe"
  446. # If (!(Test-Path $onedrive)) {
  447. #   $onedrive = "$env:SYSTEMROOT\System32\OneDriveSetup.exe"
  448. # }
  449. # Start-Process $onedrive -NoNewWindow
  450.  
  451. # Uninstall default Microsoft applications
  452. Write-Host "Uninstalling default Microsoft applications..."
  453. Get-AppxPackage "Microsoft.3DBuilder" | Remove-AppxPackage
  454. Get-AppxPackage "Microsoft.BingFinance" | Remove-AppxPackage
  455. Get-AppxPackage "Microsoft.BingNews" | Remove-AppxPackage
  456. Get-AppxPackage "Microsoft.BingSports" | Remove-AppxPackage
  457. Get-AppxPackage "Microsoft.BingWeather" | Remove-AppxPackage
  458. Get-AppxPackage "Microsoft.Getstarted" | Remove-AppxPackage
  459. Get-AppxPackage "Microsoft.MicrosoftOfficeHub" | Remove-AppxPackage
  460. # Get-AppxPackage "Microsoft.MicrosoftSolitaireCollection" | Remove-AppxPackage
  461. # Get-AppxPackage "Microsoft.Office.OneNote" | Remove-AppxPackage
  462. # Get-AppxPackage "Microsoft.People" | Remove-AppxPackage
  463. # Get-AppxPackage "Microsoft.SkypeApp" | Remove-AppxPackage
  464. # Get-AppxPackage "Microsoft.Windows.Photos" | Remove-AppxPackage
  465. # Get-AppxPackage "Microsoft.WindowsAlarms" | Remove-AppxPackage
  466. # Get-AppxPackage "Microsoft.WindowsCamera" | Remove-AppxPackage
  467. # Get-AppxPackage "microsoft.windowscommunicationsapps" | Remove-AppxPackage
  468. # Get-AppxPackage "Microsoft.WindowsMaps" | Remove-AppxPackage
  469. Get-AppxPackage "Microsoft.WindowsPhone" | Remove-AppxPackage
  470. # Get-AppxPackage "Microsoft.WindowsSoundRecorder" | Remove-AppxPackage
  471. Get-AppxPackage "Microsoft.XboxApp" | Remove-AppxPackage
  472. # Get-AppxPackage "Microsoft.ZuneMusic" | Remove-AppxPackage
  473. # Get-AppxPackage "Microsoft.ZuneVideo" | Remove-AppxPackage
  474. # Get-AppxPackage "Microsoft.AppConnector" | Remove-AppxPackage
  475. # Get-AppxPackage "Microsoft.ConnectivityStore" | Remove-AppxPackage
  476. # Get-AppxPackage "Microsoft.Office.Sway" | Remove-AppxPackage
  477. # Get-AppxPackage "Microsoft.Messaging" | Remove-AppxPackage
  478. # Get-AppxPackage "Microsoft.CommsPhone" | Remove-AppxPackage
  479. # Get-AppxPackage "9E2F88E3.Twitter" | Remove-AppxPackage
  480. Get-AppxPackage "king.com.CandyCrushSodaSaga" | Remove-AppxPackage
  481.  
  482. # Install default Microsoft applications
  483. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.3DBuilder").InstallLocation)\AppXManifest.xml"
  484. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.BingFinance").InstallLocation)\AppXManifest.xml"
  485. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.BingNews").InstallLocation)\AppXManifest.xml"
  486. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.BingSports").InstallLocation)\AppXManifest.xml"
  487. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.BingWeather").InstallLocation)\AppXManifest.xml"
  488. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.Getstarted").InstallLocation)\AppXManifest.xml"
  489. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.MicrosoftOfficeHub").InstallLocation)\AppXManifest.xml"
  490. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.MicrosoftSolitaireCollection").InstallLocation)\AppXManifest.xml"
  491. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.Office.OneNote").InstallLocation)\AppXManifest.xml"
  492. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.People").InstallLocation)\AppXManifest.xml"
  493. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.SkypeApp").InstallLocation)\AppXManifest.xml"
  494. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.Windows.Photos").InstallLocation)\AppXManifest.xml"
  495. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.WindowsAlarms").InstallLocation)\AppXManifest.xml"
  496. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.WindowsCamera").InstallLocation)\AppXManifest.xml"
  497. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.windowscommunicationsapps").InstallLocation)\AppXManifest.xml"
  498. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.WindowsMaps").InstallLocation)\AppXManifest.xml"
  499. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.WindowsPhone").InstallLocation)\AppXManifest.xml"
  500. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.WindowsSoundRecorder").InstallLocation)\AppXManifest.xml"
  501. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.XboxApp").InstallLocation)\AppXManifest.xml"
  502. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.ZuneMusic").InstallLocation)\AppXManifest.xml"
  503. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.ZuneVideo").InstallLocation)\AppXManifest.xml"
  504. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.AppConnector").InstallLocation)\AppXManifest.xml"
  505. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.ConnectivityStore").InstallLocation)\AppXManifest.xml"
  506. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.Office.Sway").InstallLocation)\AppXManifest.xml"
  507. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.Messaging").InstallLocation)\AppXManifest.xml"
  508. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.CommsPhone").InstallLocation)\AppXManifest.xml"
  509. # In case you have removed them for good, you can try to restore the files using installation medium as follows
  510. # New-Item C:\Mnt -Type Directory | Out-Null
  511. # dism /Mount-Image /ImageFile:D:\sources\install.wim /index:1 /ReadOnly /MountDir:C:\Mnt
  512. # robocopy /S /SEC /R:0 "C:\Mnt\Program Files\WindowsApps" "C:\Program Files\WindowsApps"
  513. # dism /Unmount-Image /Discard /MountDir:C:\Mnt
  514. # Remove-Item -Path C:\Mnt -Recurse
  515.  
  516. # Uninstall Windows Media Player
  517. # Write-Host "Uninstalling Windows Media Player..."
  518. # dism /online /Disable-Feature /FeatureName:MediaPlayback /Quiet /NoRestart
  519.  
  520. # Install Windows Media Player
  521. # dism /online /Enable-Feature /FeatureName:MediaPlayback /Quiet /NoRestart
  522.  
  523. # Uninstall Work Folders Client
  524. # Write-Host "Uninstalling Work Folders Client..."
  525. # dism /online /Disable-Feature /FeatureName:WorkFolders-Client /Quiet /NoRestart
  526.  
  527. # Install Work Folders Client
  528. # dism /online /Enable-Feature /FeatureName:WorkFolders-Client /Quiet /NoRestart
  529.  
  530. # Set Photo Viewer as default for bmp, gif, jpg and png
  531. Write-Host "Setting Photo Viewer as default for bmp, gif, jpg, png and tif..."
  532. If (!(Test-Path "HKCR:")) {
  533.     New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null
  534. }
  535. ForEach ($type in @("Paint.Picture", "giffile", "jpegfile", "pngfile")) {
  536.     New-Item -Path $("HKCR:\$type\shell\open") -Force | Out-Null
  537.     New-Item -Path $("HKCR:\$type\shell\open\command") | Out-Null
  538.     Set-ItemProperty -Path $("HKCR:\$type\shell\open") -Name "MuiVerb" -Type ExpandString -Value "@%ProgramFiles%\Windows Photo Viewer\photoviewer.dll,-3043"
  539.     Set-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"
  540. }
  541.  
  542. # Remove or reset default open action for bmp, gif, jpg and png
  543. # If (!(Test-Path "HKCR:")) {
  544. #   New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null
  545. # }
  546. # Remove-Item -Path "HKCR:\Paint.Picture\shell\open" -Recurse
  547. # Remove-ItemProperty -Path "HKCR:\giffile\shell\open" -Name "MuiVerb"
  548. # Set-ItemProperty -Path "HKCR:\giffile\shell\open" -Name "CommandId" -Type String -Value "IE.File"
  549. # Set-ItemProperty -Path "HKCR:\giffile\shell\open\command" -Name "(Default)" -Type String -Value "`"$env:SystemDrive\Program Files\Internet Explorer\iexplore.exe`" %1"
  550. # Set-ItemProperty -Path "HKCR:\giffile\shell\open\command" -Name "DelegateExecute" -Type String -Value "{17FE9752-0B5A-4665-84CD-569794602F5C}"
  551. # Remove-Item -Path "HKCR:\jpegfile\shell\open" -Recurse
  552. # Remove-Item -Path "HKCR:\pngfile\shell\open" -Recurse
  553.  
  554. # Show Photo Viewer in "Open with..."
  555. Write-Host "Showing Photo Viewer in `"Open with...`""
  556. If (!(Test-Path "HKCR:")) {
  557.     New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null
  558. }
  559. New-Item -Path "HKCR:\Applications\photoviewer.dll\shell\open\command" -Force | Out-Null
  560. New-Item -Path "HKCR:\Applications\photoviewer.dll\shell\open\DropTarget" -Force | Out-Null
  561. Set-ItemProperty -Path "HKCR:\Applications\photoviewer.dll\shell\open" -Name "MuiVerb" -Type String -Value "@photoviewer.dll,-3043"
  562. Set-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"
  563. Set-ItemProperty -Path "HKCR:\Applications\photoviewer.dll\shell\open\DropTarget" -Name "Clsid" -Type String -Value "{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}"
  564.  
  565. # Remove Photo Viewer from "Open with..."
  566. # If (!(Test-Path "HKCR:")) {
  567. #   New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null
  568. # }
  569. # Remove-Item -Path "HKCR:\Applications\photoviewer.dll\shell\open" -Recurse
  570.  
  571. ##########
  572. # Restart
  573. ##########
  574. Write-Host
  575. Write-Host "Press any key to restart your system..." -ForegroundColor Black -BackgroundColor White
  576. $key = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
  577. Write-Host "Restarting..."
  578. Restart-Computer
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement