Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #//Admin-Loader
- If (-NOT([Security.Principal.WindowsPrincipal]`
- [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(`
- [Security.Principal.WindowsBuiltInRole] “Administrator”))
- {
- $Arguments = "& '" + $script:MyInvocation.MyCommand.Path + "'"
- Start-Process powershell -argumentlist $arguments -Verb runAs
- Break
- }
- #//Script-Start
- #//Advanced Firewall profile
- netsh advfirewall import $env:userprofile\desktop\default.wfw | out-null
- #//Poweroptions
- powercfg -h off
- #//Setting registry keys
- #// Initialize an array
- $RegistryEntries = @()
- #// Create a PSObject with the associated properties hashtable
- #//Disabling Xbox Capture
- $RegTable = new-object PSObject -Property @{ Key = 'Registry::HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR';
- Name = 'AppCaptureEnabled';
- PropertyType = 'Dword';
- Value = '00000000'}
- $RegistryEntries += $regtable
- #//Disabling Xbox GameDVR overlay
- $RegTable = new-object PSObject -Property @{ Key = 'Registry::HKEY_CURRENT_USER\SYSTEM\GameConfigStore';
- Name = 'GameDVR_Enabled';
- PropertyType = 'Dword';
- Value = '00000000'}
- $RegistryEntries += $regtable
- #//Disabling Cortana
- $RegTable = new-object PSObject -Property @{ Key = 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search';
- Name = 'AllowCortana';
- PropertyType = 'Dword';
- Value = '00000000'}
- $RegistryEntries += $regtable
- #//Disabling Cortana Lock Screen
- $RegTable = new-object PSObject -Property @{ Key = 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search';
- Name = 'AllowCortanaAboveLock';
- PropertyType = 'Dword';
- Value = '00000000'}
- $RegistryEntries += $regtable
- #//Disabling UAC
- $RegTable = new-object PSObject -Property @{ Key = 'REGISTRY::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System';
- Name = 'EnableLUA';
- PropertyType = 'Dword';
- Value = '00000000'}
- $RegistryEntries += $regtable
- #//Disabling Start Menu suggested content
- $RegTable = new-object PSObject -Property @{ Key = 'REGISTRY::HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\CloudContent';
- Name = 'DisableWindowsConsumerFeatures';
- PropertyType = 'Dword';
- Value = '00000001'}
- $RegistryEntries += $regtable
- #//Invoking registry changes
- ForEach ($line in $RegistryEntries)
- {
- IF ((Test-Path -Path $line.key)-ne "True")
- {
- New-Item -Path $line.key | out-Null
- }
- New-ItemProperty -Force -Path $line.key -Name $line.name -Value $line.value -PropertyType $line.propertytype
- }
- #//Nulling Variables
- $line = $null
- $RegistryEntries = $null
- $RegTable = $null
- #//Configuring Services
- $StopServiceArray = @('HomeGroupListener';
- 'HomeGroupProvider')
- ForEach ($line in $StopServiceArray)
- {
- Stop-Service -Name $line
- Set-Service -Name $line -Status Stopped -StartupType Disabled
- }
- #//Nulling Variables
- $line = $null
- $StopServiceArray = $null
- #//uninstalling store 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 *people* | Remove-AppxPackage
- Get-AppxPackage *windowsphone* | 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 *messaging* | Remove-AppxPackage
- Get-AppxPackage *oneconnect* | Remove-AppxPackage
- Get-AppxPackage *Minecraft* | Remove-AppxPackage
- Get-AppxPackage *HPPrinterControl* | Remove-AppxPackage
- Get-AppxPackage *CandyCrush* | Remove-AppxPackage
- Get-AppxPackage *Playtika.CaesarsSlotsFreeCasino* | Remove-AppxPackage
- Get-AppxPackage *advertising* | Remove-AppxPackage
- Get-AppxPackage *DesktopAppInstaller* | Remove-AppxPackage
- Get-AppxPackage *XboxIdentityProvider* | Remove-AppxPackage
- Get-AppxPackage *WindowsFeedbackHub* | Remove-AppxPackage
- Get-AppxPackage *Facebook* | Remove-AppxPackage
- Get-AppxPackage *twitter* | Remove-AppxPackage
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement