############### #Sean McCarthy# # 11-18-2016 # ############### ############### # Revised # # 05-04-2018 # ############### ############### #Open as Admin# ############### If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { $arguments = "& '" + $myinvocation.mycommand.definition + "'" Start-Process powershell -Verb runAs -ArgumentList $arguments Break } pause clear ################### #Remove Metro Apps# ################### echo "Removing Metro Apps" Get-AppxPackage *3dbuilder* | Remove-AppxPackage Get-AppxPackage *windowsalarms* | Remove-AppxPackage Get-AppxPackage *windowscommunicationsapps* | Remove-AppxPackage Get-AppxPackage *windowscamera* | Remove-AppxPackage Get-AppxPackage *officehub* | Remove-AppxPackage Get-AppxPackage *skypeapp* | Remove-AppxPackage Get-AppxPackage *getstarted* | Remove-AppxPackage Get-AppxPackage *zunemusic* | Remove-AppxPackage Get-AppxPackage *windowsmaps* | Remove-AppxPackage Get-AppxPackage *solitairecollection* | Remove-AppxPackage Get-AppxPackage *bingfinance* | Remove-AppxPackage Get-AppxPackage *zunevideo* | Remove-AppxPackage Get-AppxPackage *bingnews* | Remove-AppxPackage Get-AppxPackage *onenote* | Remove-AppxPackage Get-AppxPackage *windowsphone* | Remove-AppxPackage Get-AppxPackage *photos* | Remove-AppxPackage Get-AppxPackage *bingsports* | Remove-AppxPackage Get-AppxPackage *soundrecorder* | Remove-AppxPackage Get-AppxPackage *bingweather* | Remove-AppxPackage Get-AppxPackage *xboxapp* | Remove-AppxPackage Get-AppxPackage *phone* | Remove-AppxPackage Get-AppxPackage *candycrush* | Remove-AppxPackage Get-AppxPackage *asphalt8* | Remove-AppxPackage Get-AppxPackage *falloutshelter* | Remove-AppxPackage Get-AppxPackage *facebook* | Remove-AppxPackage Get-AppxPackage *twitter* | Remove-AppxPackage Get-AppxPackage *marchofempires* | Remove-AppxPackage Get-AppxPackage *oneconnect* | Remove-AppxPackage Get-AppxPackage *skypeforbusiness* | Remove-AppxPackage Get-AppxPackage *xboxapp* | Remove-AppxPackage Get-AppxPackage *minecraft* | Remove-AppxPackage Get-AppxPackage *bubblewitch3* | Remove-AppxPackage echo "Removal Finished!!" pause clear ############################### # RunTimeBroker Registry Edit # ############################### echo "Editing RunTimeBroker parameters in Registry..." $Path1 = Test-Path HKLM:\SYSTEM\CurrentControlSet\Services\TimeBrokerSvc $Path2 = Test-Path HKLM:\SYSTEM\CurrentControlSet\Services\TimeBroker If ($Path1 -eq $True) { Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\TimeBrokerSvc" -Name "Start" -Value 3 } ElseIf ($Path -eq $True) { Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\TimeBroker" -Name "Start" -Value 3 } echo "Program Finished" pause clear ############################# # Setting Windows Services # ############################# echo "Setting custom services startup entries..." Set-Service BITS -StartupType "Disabled" # Background Intelligent Transfer Service Set-Service wuauserv -StartupType "Manual" # Windows Update Set-Service WSearch -StartupType "Manual" # Windows Search Set-Service SysMain -StartupType "Disabled" # Superfetch echo "Finished!!" pause clear ###################################################### # Setting Security for Powershell & Command cleanup # ###################################################### echo "Setting Powershell Write Security..." Set-ExecutionPolicy Restricted echo "Finished!!" echo "Clearing commands history..." del (Get-PSReadlineOption).HistorySavePath echo "Finished!!" pause clear echo "Windows 10 optimizations are now completed. You may exit the program"