Skip to content

Instantly share code, notes, and snippets.

@jdmonty
Last active March 7, 2021 04:38
Show Gist options
  • Save jdmonty/b51ac2d1332449fc02205f0e69cfb1e0 to your computer and use it in GitHub Desktop.
Save jdmonty/b51ac2d1332449fc02205f0e69cfb1e0 to your computer and use it in GitHub Desktop.
Update-ExecutionPolicy -Policy RemoteSigned
$Boxstarter.RebootOk=$true # Allow reboots?
$Boxstarter.NoPassword=$false # Is this a machine with no login password?
$Boxstarter.AutoLogin=$true # Save my password securely and auto-login after a reboot
# Trust PSGallery
Get-PackageProvider -Name Nuget -ForceBootstrap
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
# Temporary
Disable-UAC
Disable-BingSearch
Disable-GameBarTips
If (-Not (Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo")) {
New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo | Out-Null
}
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 0
# WiFi Sense: HotSpot Sharing: Disable
If (-Not (Test-Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting")) {
New-Item -Path HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting | Out-Null
}
Set-ItemProperty -Path HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting -Name value -Type DWord -Value 0
# WiFi Sense: Shared HotSpot Auto-Connect: Disable
Set-ItemProperty -Path HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots -Name value -Type DWord -Value 0
# Start Menu: Disable Bing Search Results
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search -Name BingSearchEnabled -Type DWord -Value 0
# Start Menu: Disable Cortana
New-Item -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows' -Name 'Windows Search' -ItemType Key
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search' -Name AllowCortana -Type DWORD -Value 0
# Disable SMBv1
Disable-WindowsOptionalFeature -Online -FeatureName smb1protocol
# Disable Internet Explorer Enhanced Security
Disable-InternetExplorerESC
############################
# Personal Preferences on UI
############################
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowFileExtensions -EnableShowFullPathInTitleBar
#Set-TaskbarOptions -Size Small
# Move "Documents" folder to OneDrive
#Move-LibraryDirectory "Personal" "$env:UserProfile\OneDrive\documents"
# Disable defrag (no need when having an SSD)
Get-ScheduledTask -TaskName *defrag* | Disable-ScheduledTask
# Change Explorer home screen back to "This PC"
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name LaunchTo -Type DWord -Value 1
# Better File Explorer
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name NavPaneExpandToCurrentFolder -Value 1
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name NavPaneShowAllFolders -Value 1
Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name MMTaskbarMode -Value 2
# These make "Quick Access" behave much closer to the old "Favorites"
# Disable Quick Access: Recent Files
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShowRecent -Type DWord -Value 0
# Disable Quick Access: Frequent Folders
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShowFrequent -Type DWord -Value 0
# Disable the Lock Screen (the one before password prompt - to prevent dropping the first character)
If (-Not (Test-Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization)) {
New-Item -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows -Name Personalization | Out-Null
}
Set-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization -Name NoLockScreen -Type DWord -Value 1
# Lock screen (not sleep) on lid close
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Power' -Name AwayModeEnabled -Type DWord -Value 1
# Disable Xbox Gamebar
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR" -Name AppCaptureEnabled -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\System\GameConfigStore" -Name GameDVR_Enabled -Type DWord -Value 0
# Turn off People in Taskbar
If (-Not (Test-Path "HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People")) {
New-Item -Path HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People | Out-Null
}
Set-ItemProperty -Path "HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People" -Name PeopleBand -Type DWord -Value 0
###############################
# Windows 10 Metro App Removals
###############################
# 3D Builder
Get-AppxPackage Microsoft.3DBuilder | Remove-AppxPackage
# Alarms
Get-AppxPackage Microsoft.WindowsAlarms | Remove-AppxPackage
# Autodesk
Get-AppxPackage *Autodesk* | Remove-AppxPackage
# Bing Weather, News, Sports, and Finance (Money):
Get-AppxPackage Microsoft.BingFinance | Remove-AppxPackage
Get-AppxPackage Microsoft.BingNews | Remove-AppxPackage
Get-AppxPackage Microsoft.BingSports | Remove-AppxPackage
Get-AppxPackage Microsoft.BingWeather | Remove-AppxPackage
# BubbleWitch
Get-AppxPackage *BubbleWitch* | Remove-AppxPackage
# Candy Crush
Get-AppxPackage king.com.CandyCrush* | Remove-AppxPackage
# Comms Phone
Get-AppxPackage Microsoft.CommsPhone | Remove-AppxPackage
# Dell
Get-AppxPackage *Dell* | Remove-AppxPackage
# Disney Magic Kingdom
Get-AppxPackage *DisneyMagicKingdom* | Remove-AppxPackage
# Dropbox
Get-AppxPackage *Dropbox* | Remove-AppxPackage
# Facebook
Get-AppxPackage *Facebook* | Remove-AppxPackage
# Feedback Hub
Get-AppxPackage Microsoft.WindowsFeedbackHub | Remove-AppxPackage
# Get Started
Get-AppxPackage Microsoft.Getstarted | Remove-AppxPackage
# Hidden City: Hidden Object Adventure
Get-AppxPackage *HiddenCityMysteryofShadows* | Remove-AppxPackage
# Keeper
Get-AppxPackage *Keeper* | Remove-AppxPackage
# Mail & Calendar
Get-AppxPackage microsoft.windowscommunicationsapps | Remove-AppxPackage
# Maps
Get-AppxPackage Microsoft.WindowsMaps | Remove-AppxPackage
# March of Empires
Get-AppxPackage *MarchofEmpires* | Remove-AppxPackage
# McAfee Security
Get-AppxPackage *McAfee* | Remove-AppxPackage
# Uninstall McAfee Security App
$mcafee = gci "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall" | foreach { gp $_.PSPath } | ? { $_ -match "McAfee Security" } | select UninstallString
if ($mcafee) {
$mcafee = $mcafee.UninstallString -Replace "C:\Program Files\McAfee\MSC\mcuihost.exe",""
Write "Uninstalling McAfee..."
start-process "C:\Program Files\McAfee\MSC\mcuihost.exe" -arg "$mcafee" -Wait
}
# Messaging
Get-AppxPackage Microsoft.Messaging | Remove-AppxPackage
# Minecraft
Get-AppxPackage *Minecraft* | Remove-AppxPackage
# Netflix
Get-AppxPackage *Netflix* | Remove-AppxPackage
# Office Hub
Get-AppxPackage Microsoft.MicrosoftOfficeHub | Remove-AppxPackage
# One Connect
Get-AppxPackage Microsoft.OneConnect | Remove-AppxPackage
# OneNote
Get-AppxPackage Microsoft.Office.OneNote | Remove-AppxPackage
# People
Get-AppxPackage Microsoft.People | Remove-AppxPackage
# Phone
Get-AppxPackage Microsoft.WindowsPhone | Remove-AppxPackage
# Photos
Get-AppxPackage Microsoft.Windows.Photos | Remove-AppxPackage
# Plex
Get-AppxPackage *Plex* | Remove-AppxPackage
# Skype (Metro version)
Get-AppxPackage Microsoft.SkypeApp | Remove-AppxPackage
# Sound Recorder
Get-AppxPackage Microsoft.WindowsSoundRecorder | Remove-AppxPackage
# Solitaire
Get-AppxPackage *Solitaire* | Remove-AppxPackage
# Sticky Notes
Get-AppxPackage Microsoft.MicrosoftStickyNotes | Remove-AppxPackage
# Sway
Get-AppxPackage Microsoft.Office.Sway | Remove-AppxPackage
# Twitter
Get-AppxPackage *Twitter* | Remove-AppxPackage
# Xbox
Get-AppxPackage Microsoft.XboxApp | Remove-AppxPackage
Get-AppxPackage Microsoft.XboxIdentityProvider | Remove-AppxPackage
# Zune Music, Movies & TV
Get-AppxPackage Microsoft.ZuneMusic | Remove-AppxPackage
Get-AppxPackage Microsoft.ZuneVideo | Remove-AppxPackage
###############################
# Power Settings
###############################
# Turn off hibernation
powercfg /H OFF
# Change Power saving options (ac=plugged in dc=battery)
powercfg -change -monitor-timeout-ac 0
powercfg -change -monitor-timeout-dc 15
powercfg -change -standby-timeout-ac 0
powercfg -change -standby-timeout-dc 30
powercfg -change -disk-timeout-ac 0
powercfg -change -disk-timeout-dc 0
powercfg -change -hibernate-timeout-ac 0
cinst Microsoft-Hyper-V-All -source windowsFeatures
cinst Microsoft-Windows-Subsystem-Linux -source windowsFeatures
cinst TelnetClient -source windowsFeatures
# .NET 3.5
choco install dotnet3.5
if (Test-PendingReboot) { Invoke-Reboot }
# .NET 4.5
choco install dotnet4.5
if (Test-PendingReboot) { Invoke-Reboot }
cinst dotnet4.7.2 -y
if (Test-PendingReboot) { Invoke-Reboot }
cinst 7zip -y
cinst git -y --params "/GitAndUnixToolsOnPath /NoGitLfs /SChannel /NoAutoCrlf"
cinst sysinternals -y
cinst nirlauncher -y
cinst blackbird -y
# https://www.sordum.org/9416/powerrun-v1-4-run-with-highest-privileges/
cinst powershell-core -y
cinst python -y
cinst cmder -y
cinst microsoft-windows-terminal -y
cinst totalcommander -y --params '/DefaultFM /AddCommanderPath'
cinst autohotkey -y
# A COMMAND-LINE FUZZY FINDER
cinst fzf -y
cinst everything -y --params '/Service /RunOnSystemStartup'
cinst dngrep -y
# rga: ripgrep, but also search in PDFs, E-Books, Office documents, zip, tar.gz, etc
cinst ripgrep-all -y
cinst vscode -y
choco install beyondcompare -y
cinst googlechrome -y
cinst screentogif -y
cinst sharex -y
cinst vlc --params '/Language:en'
cinst vlc-skins
choco feature disable -n=allowGlobalConfirmation
Enable-MicrosoftUpdate
Install-WindowsUpdate -acceptEula
Enable-UAC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment