diff --git a/demos/GistScript.ps1 b/demos/GistScript.ps1 new file mode 100644 index 00000000..20202640 --- /dev/null +++ b/demos/GistScript.ps1 @@ -0,0 +1,958 @@ + +# configuration for a basic windows 11 clean install + +# Step 1: +# install Chocolatey if necessary and then install the necessary boxstarter modules +# +# If you are running PowerShell v3 or higher: +# . { iwr -useb https://boxstarter.org/bootstrapper.ps1 } | iex; Get-Boxstarter -Force +# +# If you are running PowerShell v2: +# iex ((New-Object System.Net.WebClient).DownloadString('https://boxstarter.org/bootstrapper.ps1')); Get-Boxstarter -Force + +# Step 2 +# Save the script to a GitHub Gist +# Click the "View Raw" link +# Copy the raw URL +# +# Run the script: +# Install-BoxstarterPackage -PackageName [Raw Url goes here] -DisableReboots +# +# Command will look like this: +# Install-BoxstarterPackage -PackageName https://gist.github.com/mwrock/7382880/raw/f6525387b4b524b8eccef6ed4d5ec219c82c0ac7/gistfile1.txt -DisableReboots + + +############################################# +# Initialization +############################################# + +#--- Boxstarter options --- +$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 + +#--- Basic setup --- +Update-ExecutionPolicy -Policy RemoteSigned +Disable-UAC +choco feature enable -n=allowGlobalConfirmation +$ConfirmPreference = "None" #ensure installing powershell modules don't prompt on needed dependencies + + +############################################# +# General Settings +############################################# + +Write-Host "Configuring General Settings..." -ForegroundColor "Yellow" + +# General: Set Computer Name +Write-Host "Setting Computer Name..." -ForegroundColor "Yellow" +(Get-WmiObject Win32_ComputerSystem).Rename("CHOZO") | Out-Null + +# General: Enable Developer Mode: Enable: 1, Disable: 0 +#Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" "AllowDevelopmentWithoutDevLicense" 0 + +# General: Bash on Windows +# Enable-WindowsOptionalFeature -Online -All -FeatureName "Microsoft-Windows-Subsystem-Linux" -NoRestart -WarningAction SilentlyContinue | Out-Null + +# General: Disable Sticky Keys +Write-Host "Disabling Sticky Keys..." -ForegroundColor "Yellow" +Set-ItemProperty -Path "HKCU:\Control Panel\Accessibility\StickyKeys" -Name "Flags" -Type String -Value "506" + +# General: Enable NumLock After Startup +Write-Host "Enabling NumLock After Startup..." -ForegroundColor "Yellow" +If (!(Test-Path "HKU:")) { + New-PSDrive -Name HKU -PSProvider Registry -Root HKEY_USERS | Out-Null +} +Set-ItemProperty -Path "HKU:\.DEFAULT\Control Panel\Keyboard" -Name "InitialKeyboardIndicators" -Type DWord -Value 2147483650 +Add-Type -AssemblyName System.Windows.Forms +If (!([System.Windows.Forms.Control]::IsKeyLocked('NumLock'))) { + $wsh = New-Object -ComObject WScript.Shell + $wsh.SendKeys('{NUMLOCK}') +} + +# General: Permanently Delete Edge Shortcut From Desktop +# Error: Doesn't work +# If (!(Test-Path "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EdgeUpdate")) { +# New-Item -Path "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EdgeUpdate" | Out-Null +# } +# Set-ItemProperty -Path "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EdgeUpdate" -Name "CreateDesktopShortcutDefault" -Type DWord -Value 0 + +# General: Windows should never ask for my feedback +Write-Host "Disabling Feedback..." -ForegroundColor "Yellow" +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Siuf")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Siuf" -Type Folder | Out-Null} +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" "NumberOfSIUFInPeriod" 0 + +# This might should go down in privacy with suggested apps & content delivery manager +# General: Disable tips and suggestions for welcome and what's new: Enable: 1, Disable: 0 +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "SubscribedContent-310093Enabled" 0 + +# General: Disable Autoplay +Write-Host "Disabling Autoplay..." +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers" -Name "DisableAutoplay" -Type DWord -Value 1 + +# General: Disable Shared Experiences +Write-Host "Disabling Shared Experiences..." -ForegroundColor "Yellow" +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CDP" -Name "RomeSdkChannelUserAuthzPolicy" -Type DWord -Value 0 + +# General: Show Task Manager Details +# Error: This just hangs; there's a sleep timer but I'm impatient +# If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\TaskManager")) { +# New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\TaskManager" -Force | Out-Null +# } +# $preferences = Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\TaskManager" -Name "Preferences" -ErrorAction SilentlyContinue +# If (!($preferences)) { +# $taskmgr = Start-Process -WindowStyle Hidden -FilePath taskmgr.exe -PassThru +# While (!($preferences)) { +# Start-Sleep -m 250 +# $preferences = Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\TaskManager" -Name "Preferences" -ErrorAction SilentlyContinue +# } +# Stop-Process $taskmgr +# } +# $preferences.Preferences[28] = 0 +# Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\TaskManager" -Name "Preferences" -Type Binary -Value $preferences.Preferences + +# General: Disable OneDrive +Write-Host "Disabling OneDrive..." -ForegroundColor "Yellow" +If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive")) { + New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" | Out-Null +} +Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" -Name "DisableFileSyncNGSC" -Type DWord -Value 1 + +# General: Disable Cortana +Write-Host "Disabling Cortana..." -ForegroundColor "Yellow" +If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings")) { + New-Item -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Force | Out-Null +} +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy" -Type DWord -Value 0 +If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization")) { + New-Item -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Force | Out-Null +} +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitTextCollection" -Type DWord -Value 1 +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitInkCollection" -Type DWord -Value 1 +If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore")) { + New-Item -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Force | Out-Null +} +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Name "HarvestContacts" -Type DWord -Value 0 +If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search")) { + New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Force | Out-Null +} +Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "AllowCortana" -Type DWord -Value 0 + +############################################# +# Privacy Settings +############################################# + +Write-Host "Configuring Privacy..." -ForegroundColor "Yellow" + +Disable-BingSearch +Disable-GameBarTips + +# Privacy: Disable Telemetry +Write-Host "Disabling Telemetry..." -ForegroundColor "Yellow" +Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0 +Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0 +Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0 +Disable-ScheduledTask -TaskName "Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" | Out-Null +# #Error: Couldn't find this task +# Disable-ScheduledTask -TaskName "Microsoft\Windows\Application Experience\ProgramDataUpdater" | Out-Null +Disable-ScheduledTask -TaskName "Microsoft\Windows\Autochk\Proxy" | Out-Null +Disable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience Improvement Program\Consolidator" | Out-Null +Disable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" | Out-Null +Disable-ScheduledTask -TaskName "Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector" | Out-Null + +# If above method doesn't work +# Privacy: Telemetry: Send Diagnostic and usage data: Basic: 1, Enhanced: 2, Full: 3 +#Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" "AllowTelemetry" 1 +#Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" "MaxTelemetryAllowed" 1 + +# Privacy: Disable Advertising ID +Write-Host "Disabling Advertising ID..." -ForegroundColor "Yellow" +If (!(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 +If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Privacy")) { + New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Privacy" | Out-Null +} +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Privacy" -Name "TailoredExperiencesWithDiagnosticDataEnabled" -Type DWord -Value 0 + +# Privacy: Disable App Suggestions +Write-Host "Disabling App Suggestions..." -ForegroundColor "Yellow" +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "ContentDeliveryAllowed" -Type DWord -Value 0 +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "OemPreInstalledAppsEnabled" -Type DWord -Value 0 +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "PreInstalledAppsEnabled" -Type DWord -Value 0 +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "PreInstalledAppsEverEnabled" -Type DWord -Value 0 +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SilentInstalledAppsEnabled" -Type DWord -Value 0 +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338389Enabled" -Type DWord -Value 0 +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SystemPaneSuggestionsEnabled" -Type DWord -Value 0 +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338388Enabled" -Type DWord -Value 0 +If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent")) { + New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Force | Out-Null +} +Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name "DisableWindowsConsumerFeatures" -Type DWord -Value 1 + +# Privacy: Speech, Inking, & Typing: Stop "Getting to know me" +Write-Host "Disabling Speech, Inking, & Typing..." -ForegroundColor "Yellow" +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\InputPersonalization" "RestrictImplicitTextCollection" 1 +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\InputPersonalization" "RestrictImplicitInkCollection" 1 +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" "HarvestContacts" 0 +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" "AcceptedPrivacyPolicy" 0 +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Speech_OneCore\Settings")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Speech_OneCore\Settings" -Type Folder | Out-Null} +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Speech_OneCore\Settings\OnlineSpeechPrivacy")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Speech_OneCore\Settings\OnlineSpeechPrivacy" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Speech_OneCore\Settings\OnlineSpeechPrivacy" "HasAccepted" 0 + +# Privacy: Disable Map Updates +Write-Host "Disabling Map Updates..." -ForegroundColor "Yellow" +Set-ItemProperty -Path "HKLM:\SYSTEM\Maps" -Name "AutoUpdateEnabled" -Type DWord -Value 0 + +# Privacy: Disable Location Tracking +Write-Host "Disabling Location Tracking..." -ForegroundColor "Yellow" +Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" -Name "SensorPermissionState" -Type DWord -Value 0 +Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" -Name "Status" -Type DWord -Value 0 + +# Privacy: Disable Feedback +Write-Host "Disabling Feedback..." -ForegroundColor "Yellow" +If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules")) { + New-Item -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Force | Out-Null +} +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Name "NumberOfSIUFInPeriod" -Type DWord -Value 0 +Disable-ScheduledTask -TaskName "Microsoft\Windows\Feedback\Siuf\DmClient" -ErrorAction SilentlyContinue | Out-Null +Disable-ScheduledTask -TaskName "Microsoft\Windows\Feedback\Siuf\DmClientOnScenarioDownload" -ErrorAction SilentlyContinue | Out-Null + +# Privacy: Disable Error Reporting +Write-Host "Disabling Error Reporting..." -ForegroundColor "Yellow" +Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" -Name "Disabled" -Type DWord -Value 1 +Disable-ScheduledTask -TaskName "Microsoft\Windows\Windows Error Reporting\QueueReporting" | Out-Null + +# Privacy: Remove AutoLogger file and Restrict Directory +Write-Host "Removing AutoLogger File and Restrict Directory..." -ForegroundColor "Yellow" +$autoLoggerDir = "$env:PROGRAMDATA\Microsoft\Diagnosis\ETLLogs\AutoLogger" +If (Test-Path "$autoLoggerDir\AutoLogger-Diagtrack-Listener.etl") { + Remove-Item -Path "$autoLoggerDir\AutoLogger-Diagtrack-Listener.etl" +} +icacls $autoLoggerDir /deny SYSTEM:`(OI`)`(CI`)F | Out-Null + +# Privacy: Disable Application launch tracking: Enable: 1, Disable: 0 +Write-Host "Disabling Application launch tracking..." -ForegroundColor "Yellow" +Set-ItemProperty "HKCU:\\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "Start-TrackProgs" 0 + +# Privacy: Disable Diagnostics Tracking Service +Write-Host "Disabling Diagnostics Tracking Service..." -ForegroundColor "Yellow" +Stop-Service "DiagTrack" -WarningAction SilentlyContinue +Set-Service "DiagTrack" -StartupType Disabled + +# Privacy: Stop and disable WAP Push Service +Write-Host "Stop and Disable WAP Push Service..." -ForegroundColor "Yellow" +Stop-Service "dmwappushservice" -WarningAction SilentlyContinue +Set-Service "dmwappushservice" -StartupType Disabled + +############################################# +# Security Settings +############################################# + +Write-Host "Configuring Security..." -ForegroundColor "Yellow" + +# Security: Set the current network as Private +Write-Host "Setting Current Network as Private..." -ForegroundColor "Yellow" +Get-NetConnectionProfile | Set-NetConnectionProfile -NetworkCategory Private + +# Security: Disable Remote Assistance +Write-Host "Disabling Remote Assistance..." -ForegroundColor "Yellow" +Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Remote Assistance" -Name "fAllowToGetHelp" -Type DWord -Value 0 + +# Security: Disable Remote Desktop +Write-Host "Disabling Remote Desktop..." +Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server" -Name "fDenyTSConnections" -Type DWord -Value 1 +Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name "UserAuthentication" -Type DWord -Value 1 + +# Security: Disable SMBv1 +Write-Host "Disabling SMBv1..." -ForegroundColor "Yellow" +Disable-WindowsOptionalFeature -Online -FeatureName smb1protocol + +# Security: Restrict Windows P2P downloads to local network +Write-Host "Restricting Windows P2P downloads..." -ForegroundColor "Yellow" +If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config")) { + New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" | Out-Null +} +Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 1 +If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization")) { + New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization" | Out-Null +} +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization" -Name "SystemSettingsDownloadMode" -Type DWord -Value 3 + +# Security: Don't let apps share and sync with non-explicitly-paired wireless devices over uPnP: Allow, Deny +Write-Host "Restricting Share & Sync Over uPnP..." -ForegroundColor "Yellow" +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\bluetoothSync")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\bluetoothSync" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\bluetoothSync" "Value" "Deny" + +# Security: Disable Windows Update Automatic Restart +Write-Host "Disabling Windows Update Automatic Restart..." +If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU")) { + New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Force | Out-Null +} +Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoRebootWithLoggedOnUsers" -Type DWord -Value 1 +Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUPowerManagement" -Type DWord -Value 0 + +# Security: Disable Windows Update "Schedule Restart" Notifications +Write-Host "Disabling Windows Update Schedule Restart Notifications" +If (-not (Test-Path "HKCU:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings")) { + New-Item -Path HKCU:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings -Force | Out-Null +} +Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings -Name UxOption -Type DWord -Value 0 +If (-not (Test-Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings")) { + New-Item -Path HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings -Force | Out-Null +} +Set-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings -Name UxOption -Type DWord -Value 0 + +############################################# +# Startup +############################################# + +# Work in progress... +# Write-Host "Configuring Startup Settings..." -ForegroundColor "Yellow" + +# You need to navigate to: +# HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run + +# You'll see a list of apps that run on startup for the current user +# Delete the DWORD for each app you want to remove from startup + +# Also check: +# HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run. + +# You'll obviously need to repeat or something as settings are user specific + +############################################# +# Lock Screen +############################################# + +Write-Host "Configuring Lock Screen..." -ForegroundColor "Yellow" + +## Lock Screen: Enable Custom Background on the Login / Lock Screen +## Background file: C:\someDirectory\someImage.jpg +## File Size Limit: 256Kb +# Set-ItemProperty "HKLM:\Software\Policies\Microsoft\Windows\Personalization" "LockScreenImage" "C:\someDirectory\someImage.jpg" + +# Lock Screen: 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: Lock screen (not sleep) on lid close +# Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Power' -Name AwayModeEnabled -Type DWord -Value 1 + +# Lock Screen: Disable Lock screen Spotlight - New backgrounds, tips, advertisements etc. +Write-Host "Disabling Lock Screen Spotlight..." -ForegroundColor "Yellow" +Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "RotatingLockScreenEnabled" -Type DWord -Value 0 +Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "RotatingLockScreenOverlayEnabled" -Type DWord -Value 0 +Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338387Enabled" -Type DWord -Value 0 + +############################################# +# Start Menu +############################################# + +Write-Host "Configuring Start Menu..." -ForegroundColor "Yellow" + +# Start Menu: Disable Fast Startup +Write-Host "Disabling Fast Startup..." -ForegroundColor "Yellow" +Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Power" -Name "HiberbootEnabled" -Type DWord -Value 0 + +# Start Menu: Disable Web Search in Start Menu +Write-Host "Disabling Web Search in Start Menu..." -ForegroundColor "Yellow" +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "BingSearchEnabled" -Type DWord -Value 0 + If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search")) { + New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Force | Out-Null + } + Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "DisableWebSearch" -Type DWord -Value 1 + +# Start Menu: Disable Cortana in Start Menu +Write-Host "Disabling Cortana in Start Menu..." -ForegroundColor "Yellow" +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 + +# Unpin all Start Menu tiles - Not applicable to Server - Note: This function has no counterpart. You have to pin the tiles back manually. +Write-Host "Unpinning all Start Menu tiles..." +Get-ChildItem -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache\DefaultAccount" -Include "*.group" -Recurse | ForEach-Object { + $data = (Get-ItemProperty -Path "$($_.PsPath)\Current" -Name "Data").Data -Join "," + $data = $data.Substring(0, $data.IndexOf(",0,202,30") + 9) + ",0,202,80,0,0" + Set-ItemProperty -Path "$($_.PsPath)\Current" -Name "Data" -Type Binary -Value $data.Split(",") +} + +############################################# +# Taskbar +############################################# + +Write-Host "Configuring Taskbar..." -ForegroundColor "Yellow" + +# Taskbar: Taskbar small, dock to bottom, always on +Write-Host "Setting taskbar small, dock to bottom, always on..." -ForegroundColor "Yellow" +Set-BoxstarterTaskbarOptions -Size Small -Dock Bottom -Combine Full -AlwaysShowIconsOn + +# Taskbar: Dock the taskbar to the left side of the screen +Write-Output "Docking the taskbar to the left side of the screen..." + if (Test-Path 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2') { + $CurrPath = 'StuckRects2' + } + elseif (Test-Path 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3') { + $CurrPath = 'StuckRects3' + } + else { + Write-Warning 'Unable to set the taskbar setting' + return + } + $BasePath = 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer' + $RegPath = Join-Path $BasePath $CurrPath + + try { + $CurrSettings = (Get-ItemProperty $RegPath).Settings + $CurrSettings[12] = 3 + Set-ItemProperty -Path $BasePath -Name $CurrPath -Value $CurrSettings -Type Binary + } + catch { + Write-Warning "Unable to pull the current registry settings!" + } + +# Taskbar: Show taskbar on multiple displays: Show: 1, Hide: 0 +Write-Host "Setting Taskbar Is On Main Display Only..." -ForegroundColor "Yellow" +Set-ItemProperty -Path HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name MMTaskbarEnabled -Value 0 + +# Taskbar: Taskbar settings when taskbar is on all displays +# Options: +# Show taskbar buttons on all taskbars: 0 +# Show taskbar buttons on main taskbar and taskbar where window is open: 1 +# Show taskbar buttons on taskbar where window is open: 2 +# Write-Host "Setting Multi-Monitor Taskbar Mode..." -ForegroundColor "Yellow" +# Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name MMTaskbarMode -Value 2 + +## AndyA: I use widgets and search +# Taskbar: Hide the Search, Task, Widget, and Chat buttons: Show: 1, Hide: 0 +Write-Host "Hiding Chat Button..." -ForegroundColor "Yellow" +Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" "SearchboxTaskbarMode" 1 # Search +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "ShowTaskViewButton" 1 # Task +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "TaskbarDa" 1 # Widgets +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "TaskbarMn" 0 # Chat + +# Taskbar: Hide cortana: Hide: 0, Show: 1 +Write-Host "Hiding Cortana..." -ForegroundColor "Yellow" +Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowCortanaButton -Value 0 + +# Duplicate - See Above +# Taskbar: Show TaskView: Hide: 0, Show: 1 +# Write-Host "Don't Hide Taskview..." -ForegroundColor "Yellow" +# Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowTaskViewButton -Value 1 + +# Taskbar: Show colors on Taskbar, Start, and SysTray: Disabled: 0, Taskbar, Start, & SysTray: 1, Taskbar Only: 2 +Write-Host "Show Colors On Taskbar, Start, & SysTray..." -ForegroundColor "Yellow" +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" "ColorPrevalence" 1 + +# Titlebar: Disable theme colors on titlebar: Enable: 1, Disable: 0 +Write-Host "Show Theme Colors On Titlebar..." -ForegroundColor "Yellow" +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\DWM" "ColorPrevalence" 1 + +# Taskbar: Use the Windows 7-8.1 Style Volume Mixer +Write-Host "Switching to Windows 7 Volume Mixer..." -ForegroundColor "Yellow" +If (-Not (Test-Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\MTCUVC")) { + New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name MTCUVC | Out-Null +} +Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\MTCUVC" -Name EnableMtcUvc -Type DWord -Value 0 + +# Taskbar: Disable Xbox Gamebar +Write-Host "Disabling Xbox Gamebar..." -ForegroundColor "Yellow" +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 + +# Taskbar: Turn off People in Taskbar +Write-Host "Turning off People in Taskbar..." -ForegroundColor "Yellow" +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 + +# Unpin all Taskbar icons - Note: This function has no counterpart. You have to pin the icons back manually. +Write-Host "Unpinning all Taskbar icons..." +Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband" -Name "Favorites" -Type Binary -Value ([byte[]](0xFF)) +Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband" -Name "FavoritesResolve" -ErrorAction SilentlyContinue + +############################################# +# File Explorer +############################################# + +Write-Host "Configuring Explorer..." -ForegroundColor "Yellow" + +# Prerequisite: Ensure necessary registry paths +if (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer")) {New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Type Folder | Out-Null} +if (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState")) {New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState" -Type Folder | Out-Null} +if (!(Test-Path "HKLM:\Software\Policies\Microsoft\Windows\Windows Search")) {New-Item -Path "HKLM:\Software\Policies\Microsoft\Windows\Windows Search" -Type Folder | Out-Null} + +# Explorer: Show hidden files by default: Show Files: 1, Hide Files: 2 +Write-Host "Show hidden files by default..." -ForegroundColor "Yellow" +Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "Hidden" 1 + +# Explorer: Show file extensions by default: Hide: 1, Show: 0 +Write-Host "Show file extensions by default..." -ForegroundColor "Yellow" +Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "HideFileExt" 0 + +# Explorer: Show path in title bar: Hide: 0, Show: 1 +Write-Host "Do not show path in title bar..." -ForegroundColor "Yellow" +Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState" "FullPath" 0 + +# Explorer: Disable Quick Access: Recent Files +Write-Host "Disabling Quick Access: Recent Files..." -ForegroundColor "Yellow" +Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShowRecent -Type DWord -Value 0 + +# Explorer: Disable Quick Access: Frequent Folders +Write-Host "Disabling Quick Access: Frequent Folders..." -ForegroundColor "Yellow" +Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShowFrequent -Type DWord -Value 0 + +# Explorer: Expand explorer to the actual folder you're in +Write-Host "Expand explorer to the actual folder you're in..." -ForegroundColor "Yellow" +Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name NavPaneExpandToCurrentFolder -Value 1 + +# Explorer: Adds things back in your left pane like recycle bin +Write-Host "Adding things back into left pane like recycle bin..." -ForegroundColor "Yellow" +Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name NavPaneShowAllFolders -Value 1 + +# Explorer: Set Explorer view to This PC +Write-Host "Setting Explorer view to This PC..." -ForegroundColor "Yellow" +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "LaunchTo" -Type DWord -Value 1 + +# Explorer: Hide Music icon in This PC +Write-Host "Hiding Music icon in This PC..." -ForegroundColor "Yellow" +Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3dfdf296-dbec-4fb4-81d1-6a3438bcf4de}" -Recurse -ErrorAction SilentlyContinue +Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{1CF1260C-4DD0-4ebb-811F-33C572699FDE}" -Recurse -ErrorAction SilentlyContinue + +# Explorer: Hide Videos from This PC +Write-Host "Hiding Videos from This PC..." -ForegroundColor "Yellow" +Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}" -Recurse -ErrorAction SilentlyContinue +Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A0953C92-50DC-43bf-BE83-3742FED03C9C}" -Recurse -ErrorAction SilentlyContinue + +# Explorer: Hide 3D Objects from This PC +Write-Host "Hiding 3D Objects from This PC..." -ForegroundColor "Yellow" +Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}" -Recurse -ErrorAction SilentlyContinue + +# Explorer: Disable Recycle Bin Delete Confirmation Dialog: Enable: 1, Disable: 0 +Write-Host "Enabling Recycle Bin Delete Confirmation Dialog..." -ForegroundColor "Yellow" +Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" "ConfirmFileDelete" 1 + +# Explorer: Show File Operation details +Write-Host "Show File Operation details..." -ForegroundColor "Yellow" +If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager")) { + New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager" | Out-Null +} +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager" -Name "EnthusiastMode" -Type DWord -Value 1 + +############################################# +# WiFi Settings +############################################# + +Write-Host "Configuring WiFi..." -ForegroundColor "Yellow" + +# Wifi: Disable HotSpot Reporting +Write-Host "Disabling HotSpot Reporting..." -ForegroundColor "Yellow" +If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting")) { + New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Force | Out-Null +} +Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Name "Value" -Type DWord -Value 0 + +# Wifi: Disable AutoConnect +Write-Host "Disabling AutoConnect..." -ForegroundColor "Yellow" +Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" -Name "Value" -Type DWord -Value 0 + +# Wifi: Disable AutoConnectAllowedOEM +Write-Host "Disabling AutoConnectAllowedOEM..." -ForegroundColor "Yellow" +If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config")) { + New-Item -Path "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config" -Force | Out-Null +} +Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config" -Name "AutoConnectAllowedOEM" -Type Dword -Value 0 + +# Wifi: Disable WifiSense +Write-Host "Disabling WifiSense..." -ForegroundColor "Yellow" +Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config" -Name "WiFISenseAllowed" -Type Dword -Value 0 + +############################################# +# Power Config +############################################# +#Write-Host "Configuring Power Options..." -ForegroundColor "Yellow" + +# Sound: Disable Startup Sound: Enable: 0, Disable: 1 +Write-Host "Disabling Startup Sound..." -ForegroundColor "Yellow" +# Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" "DisableStartupSound" 1 +# Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\BootAnimation" "DisableStartupSound" 1 +# Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\EditionOverrides" "UserSetting_DisableStartupSound" 1 + +# Power: Disable Hibernation +Write-Host "Disabling Hibernation..." -ForegroundColor "Yellow" +# powercfg /hibernate off + +# Power: Set standby delay to 24 hours +Write-Host "Set standby delay to 24 hours..." -ForegroundColor "Yellow" +# powercfg /change /standby-timeout-ac 1440 + +# SSD: Disable SuperFetch: Enable: 1, Disable: 0 +Write-Host "Disabling SuperFetch..." -ForegroundColor "Yellow" +# Set-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters" "EnableSuperfetch" 0 + +############################################# +# Allow/Deny Applications +############################################# + +# Principle of Least Privilege (PoLP) +# Everything is a default "No" in to base image +# We can grant specific/default access later + +Write-Host "Setting Application Permissions..." -ForegroundColor "Yellow" + +# Camera: Don't let apps use camera: Allow, Deny +Write-Host "Don't let apps use camera..." -ForegroundColor "Yellow" +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\webcam")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\webcam" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\webcam" "Value" "Deny" + +# Microphone: Don't let apps use microphone: Allow, Deny +Write-Host "Don't let apps use microphone..." -ForegroundColor "Yellow" +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\microphone")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\microphone" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\microphone" "Value" "Deny" + +# Notifications: Don't let apps access notifications: Allow, Deny +Write-Host "Don't let apps access notifications..." -ForegroundColor "Yellow" +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userNotificationListener")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userNotificationListener" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userNotificationListener" "Value" "Deny" + +# Account Info: Don't let apps access name, picture, and other account info: Allow, Deny +Write-Host "Don't let apps access name, picture, and other account info..." -ForegroundColor "Yellow" +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userAccountInformation")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userAccountInformation" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userAccountInformation" "Value" "Deny" + +# Contacts: Don't let apps access contacts: Allow, Deny +Write-Host "Don't let apps access contacts..." -ForegroundColor "Yellow" +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\contacts")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\contacts" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\contacts" "Value" "Deny" + +# Calendar: Don't let apps access calendar: Allow, Deny +Write-Host "Don't let apps access calendar..." -ForegroundColor "Yellow" +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\appointments")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\appointments" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\appointments" "Value" "Deny" + +# Call History: Don't let apps make phone calls: Allow, Deny +Write-Host "Don't let apps make phone calls..." -ForegroundColor "Yellow" +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\phoneCall")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\phoneCall" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\phoneCall" "Value" "Deny" + +# Call History: Don't let apps access call history: Allow, Deny +Write-Host "Don't let apps access call history..." -ForegroundColor "Yellow" +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\phoneCallHistory")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\phoneCallHistory" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\phoneCallHistory" "Value" "Deny" + +# Diagnostics: Don't let apps access diagnostics of other apps: Allow, Deny +Write-Host "Don't let apps access diagnostics of other apps..." -ForegroundColor "Yellow" +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\appDiagnostics")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\appDiagnostics" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\appDiagnostics" "Value" "Deny" + +# Documents: Don't let apps access documents: Allow, Deny +Write-Host "Don't let apps access documents..." -ForegroundColor "Yellow" +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\documentsLibrary")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\documentsLibrary" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\documentsLibrary" "Value" "Deny" + +# Downloads: Don't let apps access downloads: Allow, Deny +Write-Host "Don't let apps access downloads..." -ForegroundColor "Yellow" +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\downloadsFolder")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\downloadsFolder" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\downloadsFolder" "Value" "Deny" + +# Email: Don't let apps read and send email: Allow, Deny +Write-Host "Don't let apps read and send email..." -ForegroundColor "Yellow" +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\email")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\email" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\email" "Value" "Deny" + +# File System: Don't let apps access the file system: Allow, Deny +Write-Host "Don't let apps access the file system..." -ForegroundColor "Yellow" +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\broadFileSystemAccess")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\broadFileSystemAccess" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\broadFileSystemAccess" "Value" "Deny" + +# Location: Don't let apps access the location: Allow, Deny +Write-Host "Don't let apps access the location..." -ForegroundColor "Yellow" +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\location" "Value" "Deny" + +# Messaging: Don't let apps read or send messages (text or MMS): Allow, Deny +Write-Host "Don't let apps read or send messages (text or MMS)..." -ForegroundColor "Yellow" +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\chat")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\chat" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\chat" "Value" "Deny" + +# Music Library: Don't let apps access music library: Allow, Deny +Write-Host "Don't let apps access music library..." -ForegroundColor "Yellow" +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\musicLibrary")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\musicLibrary" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\musicLibrary" "Value" "Deny" + +# Pictures: Don't let apps access pictures: Allow, Deny +Write-Host "Don't let apps access pictures..." -ForegroundColor "Yellow" +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\picturesLibrary")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\picturesLibrary" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\picturesLibrary" "Value" "Deny" + +# Radios: Don't let apps control radios (like Bluetooth): Allow, Deny +Write-Host "DDon't let apps control radios (like Bluetooth)..." -ForegroundColor "Yellow" +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\radios")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\radios" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\radios" "Value" "Deny" + +# Screenshot: Don't let apps take screenshots: Allow, Deny +Write-Host "Don't let apps take screenshots..." -ForegroundColor "Yellow" +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\graphicsCaptureProgrammatic")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\graphicsCaptureProgrammatic" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\graphicsCaptureProgrammatic" "Value" "Deny" + +# Screenshot Borders: Don't let apps access screenshot border settings: Allow, Deny +Write-Host "Don't let apps access screenshot border settings..." -ForegroundColor "Yellow" +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\graphicsCaptureWithoutBorder")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\graphicsCaptureWithoutBorder" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\graphicsCaptureWithoutBorder" "Value" "Deny" + +# Tasks: Don't let apps access the tasks: Allow, Deny +Write-Host "Don't let apps access the tasks..." -ForegroundColor "Yellow" +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userDataTasks")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userDataTasks" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userDataTasks" "Value" "Deny" + +# Other Devices: Don't let apps share and sync with non-explicitly-paired wireless devices over uPnP: Allow, Deny +Write-Host "Don't let apps share and sync with non-explicitly-paired wireless devices over uPnP..." -ForegroundColor "Yellow" +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\bluetoothSync")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\bluetoothSync" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\bluetoothSync" "Value" "Deny" + +# Videos: Don't let apps access videos: Allow, Deny +Write-Host "Don't let apps access videos..." -ForegroundColor "Yellow" +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\videosLibrary")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\videosLibrary" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\videosLibrary" "Value" "Deny" + +############################################################################### +### Remove Default Applications # +############################################################################### + +#--- Uninstall unnecessary applications that come with Windows out of the box --- +Write-Host "Uninstall some applications that come with Windows out of the box" -ForegroundColor "Yellow" + +# Uninstall 3D Builder +Get-AppxPackage "Microsoft.3DBuilder" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.3DBuilder" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Adobe Creative Cloud Express +Get-AppxPackage "AdobeSystemsIncorporated.AdobeCreativeCloudExpress" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "AdobeSystemsIncorporated.AdobeCreativeCloudExpress" | Remove-AppxProvisionedPackage -Online -AllUsers + +## Uninstall Alarms and Clock +#Get-AppxPackage "Microsoft.WindowsAlarms" -AllUsers | Remove-AppxPackage -AllUsers +#Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.WindowsAlarms" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Amazon Prime Video +Get-AppxPackage "AmazonVideo.PrimeVideo" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "AmazonVideo.PrimeVideo" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Autodesk Sketchbook +Get-AppxPackage "*.AutodeskSketchBook" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "*.AutodeskSketchBook" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Bing Finance +Get-AppxPackage "Microsoft.BingFinance" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.BingFinance" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Bing News +Get-AppxPackage "Microsoft.BingNews" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.BingNews" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Bing Sports +Get-AppxPackage "Microsoft.BingSports" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.BingSports" | Remove-AppxProvisionedPackage -Online -AllUsers + +## Uninstall Bing Weather +#Get-AppxPackage "Microsoft.BingWeather" -AllUsers | Remove-AppxPackage -AllUsers +#Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.BingWeather" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Bubble Witch 3 Saga +Get-AppxPackage "king.com.BubbleWitch3Saga" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "king.com.BubbleWitch3Saga" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Calendar and Mail +Get-AppxPackage "Microsoft.WindowsCommunicationsApps" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.WindowsCommunicationsApps" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Candy Crush Soda Saga +Get-AppxPackage "king.com.CandyCrushSodaSaga" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "king.com.CandyCrushSodaSaga" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall ClipChamp Video Editor +Get-AppxPackage "Clipchamp.Clipchamp" -AllUsers | Remove-AppxPackage +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Clipchamp.Clipchamp" | Remove-AppxProvisionedPackage -Online + +# Uninstall Cortana +Get-AppxPackage "Microsoft.549981C3F5F10" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.549981C3F5F10" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Disney+ +Get-AppxPackage "Disney.37853FC22B2CE" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Disney.37853FC22B2CE" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Disney Magic Kingdoms +Get-AppxPackage "*.DisneyMagicKingdoms" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "*.DisneyMagicKingdoms" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Dolby +Get-AppxPackage "DolbyLaboratories.DolbyAccess" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "DolbyLaboratories.DolbyAccess" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Facebook +Get-AppxPackage "Facebook.Facebook*" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Facebook.Facebook*" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Get Office, and it's "Get Office365" notifications +Get-AppxPackage "Microsoft.MicrosoftOfficeHub" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.MicrosoftOfficeHub" | Remove-AppxProvisionedPackage -Online -AllUsers + +## AndyA: Custom +# Uninstall Nicrosoft Feedback Hub +Get-AppxPackage "Microsoft.WindowsFeedbackHub" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.WindowsFeedbackHub" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Instagram +Get-AppxPackage "Facebook.Instagram*" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Facebook.Instagram*" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Maps +Get-AppxPackage "Microsoft.WindowsMaps" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.WindowsMaps" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall March of Empires +Get-AppxPackage "*.MarchofEmpires" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "*.MarchofEmpires" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Messaging +Get-AppxPackage "Microsoft.Messaging" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.Messaging" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Mobile Plans +Get-AppxPackage "Microsoft.OneConnect" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.OneConnect" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall OneNote +Get-AppxPackage "Microsoft.Office.OneNote" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.Office.OneNote" | Remove-AppxProvisionedPackage -Online -AllUsers + +## Uninstall Paint +#Get-AppxPackage "Microsoft.Paint" -AllUsers | Remove-AppxPackage -AllUsers +#Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.Paint" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall People +Get-AppxPackage "Microsoft.People" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.People" | Remove-AppxProvisionedPackage -Online -AllUsers + +## Uninstall Photos +#Get-AppxPackage "Microsoft.Windows.Photos" -AllUsers | Remove-AppxPackage -AllUsers +#Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.Windows.Photos" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Print3D +Get-AppxPackage "Microsoft.Print3D" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.Print3D" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Skype +Get-AppxPackage "Microsoft.SkypeApp" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.SkypeApp" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall SlingTV +Get-AppxPackage "*.SlingTV" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "*.SlingTV" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Solitaire +Get-AppxPackage "Microsoft.MicrosoftSolitaireCollection" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.MicrosoftSolitaireCollection" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Spotify +Get-AppxPackage "SpotifyAB.SpotifyMusic" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "SpotifyAB.SpotifyMusic" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall StickyNotes +Get-AppxPackage "Microsoft.MicrosoftStickyNotes" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.MicrosoftStickyNotes" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Sway +Get-AppxPackage "Microsoft.Office.Sway" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.Office.Sway" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall TikTok +Get-AppxPackage "*.TikTok" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "*.TikTok" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Microsoft ToDos +Get-AppxPackage "Microsoft.ToDos" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.ToDos" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Twitter +Get-AppxPackage "*.Twitter" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "*.Twitter" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Voice Recorder +Get-AppxPackage "Microsoft.WindowsSoundRecorder" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.WindowsSoundRecorder" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall XBox +Get-AppxPackage "Microsoft.XboxGamingOverlay" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppxPackage "Microsoft.GamingApp" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.XboxGamingOverlay" | Remove-AppxProvisionedPackage -Online -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.GamingApp" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Your Phone +Get-AppxPackage "Microsoft.YourPhone" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.YourPhone" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Zune Music (Groove) +Get-AppxPackage "Microsoft.ZuneMusic" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.ZuneMusic" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Zune Video +Get-AppxPackage "Microsoft.ZuneVideo" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.ZuneVideo" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Power Automate +#Get-AppxPackage "Microsoft.PowerAutomateDesktop" -AllUsers | Remove-AppxPackage -AllUsers +#Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.PowerAutomateDesktop" | Remove-AppxProvisionedPackage -Online -AllUsers + +########### Sketch and Power Automate might be a better way to create user profiles/personalization + +# Uninstall Screen Sketch +#Get-AppxPackage "Microsoft.ScreenSketch" -AllUsers | Remove-AppxPackage -AllUsers +#Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.ScreenSketch" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Microsoft People +Get-AppxPackage "Microsoft.People" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.People" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Windows Camera +Get-AppxPackage "Microsoft.WindowsCamera" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.WindowsCamera" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Windows Media Player +Disable-WindowsOptionalFeature -Online -FeatureName "WindowsMediaPlayer" -NoRestart -WarningAction SilentlyContinue | Out-Null + +# Prevent "Suggested Applications" from returning +# Best used if running an offline setup +# See: https://techcommunity.microsoft.com/t5/windows-blog-archive/seeing-extra-apps-turn-them-off/ba-p/706577 + +# Set-ItemProperty "HKLM:\Software\Policies\Microsoft\Windows\CloudContent" "DisableWindowsConsumerFeatures" 1 -Force +# Set-ItemProperty "HKLM:\Software\Policies\Microsoft\Windows\CloudContent" "DisableCloudOptimizedContent" 1 -Force +# Set-ItemProperty "HKLM:\Software\Policies\Microsoft\Windows\CloudContent" "DisableConsumerAccountStateContent" 1 -Force + +# See also: +# https://learn.microsoft.com/en-us/windows/application-management/remove-provisioned-apps-during-update + +RefreshEnv + +############################################# +# Clean Up +############################################# + +## set desktop wallpaper +#Invoke-WebRequest -Uri 'http://chocolateyfest.com/wp-content/uploads/2018/05/img-bg-front-page-header-NO_logo-opt.jpg' -Method Get -ContentType image/jpeg -OutFile 'C:\github\chocofest.jpg' +#Set-ItemProperty -path 'HKCU:\Control Panel\Desktop\' -name wallpaper -value 'C:\github\chocofest.jpg' +#rundll32.exe user32.dll, UpdatePerUserSystemParameters +#RefreshEnv + +Write-Host "Cleaning Up..." -ForegroundColor "Yellow" +Enable-UAC +Enable-MicrosoftUpdate +Install-WindowsUpdate -acceptEula diff --git a/demos/README.md b/demos/README.md index 75b23bd6..47b74ce8 100644 --- a/demos/README.md +++ b/demos/README.md @@ -13,7 +13,7 @@ These scripts should cover a lot of what you need but will not likely match your |Click link to run |Description | |---------|---------| -|ChocolateyFest 2018 | DevOps tools and some examples of personalization | +|ChocolateyFest 2018 | DevOps tools and some examples of personalization | | | Add to this list by submitting a PR with your example configuration! | # Contributing diff --git a/demos/chocolateyfest2018.ps1 b/demos/chocolateyfest2018.ps1 index 4c3edbf3..4651ec5a 100644 --- a/demos/chocolateyfest2018.ps1 +++ b/demos/chocolateyfest2018.ps1 @@ -1,8 +1,17 @@ -# Description: Boxstarter Script +# Description: Boxstarter Script: 1.0.0.2 # Author: Microsoft # chocolatey fest demo +#--- Boxstarter options --- +$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 + +#--- Basic setup --- +Update-ExecutionPolicy -Policy RemoteSigned Disable-UAC +Enable-RemoteDesktop +choco feature enable -n=allowGlobalConfirmation $ConfirmPreference = "None" #ensure installing powershell modules don't prompt on needed dependencies # Get the base URI path from the ScriptToCall value @@ -24,47 +33,24 @@ function executeScript { } #--- Setting up Windows --- +executeScript "PrivacySettings.ps1"; +executeScript "SecuritySettings.ps1"; +executeScript "GeneralSettings.ps1"; +executeScript "LockScreenSettings.ps1"; +executeScript "StartMenuSettings.ps1"; +executeScript "TaskbarSettings.ps1"; executeScript "FileExplorerSettings.ps1"; -executeScript "SystemConfiguration.ps1"; +executeScript "WiFiSettings.ps1"; executeScript "RemoveDefaultApps.ps1"; -executeScript "CommonDevTools.ps1"; -executeScript "Browsers.ps1"; - -executeScript "HyperV.ps1"; RefreshEnv -executeScript "WSL.ps1"; +executeScript "BasicApplications.ps1"; RefreshEnv -executeScript "Docker.ps1"; - -choco install -y powershell-core -choco install -y azure-cli -Install-Module -Force Az -Install-Module -Force posh-git -choco install -y microsoftazurestorageexplorer -choco install -y terraform - -# Install tools in WSL instance -write-host "Installing tools inside the WSL distro..." -Ubuntu1804 run apt install ansible -y -Ubuntu1804 run apt install nodejs -y -# personalize -choco install -y microsoft-teams -choco install -y office365business - -# checkout recent projects -mkdir C:\github -cd C:\github -git.exe clone https://github.com/microsoft/windows-dev-box-setup-scripts -git.exe clone https://github.com/microsoft/winappdriver -git.exe clone https://github.com/microsoft/wsl -git.exe clone https://github.com/PowerShell/PowerShell - -# set desktop wallpaper -Invoke-WebRequest -Uri 'http://chocolateyfest.com/wp-content/uploads/2018/05/img-bg-front-page-header-NO_logo-opt.jpg' -Method Get -ContentType image/jpeg -OutFile 'C:\github\chocofest.jpg' -Set-ItemProperty -path 'HKCU:\Control Panel\Desktop\' -name wallpaper -value 'C:\github\chocofest.jpg' -rundll32.exe user32.dll, UpdatePerUserSystemParameters -RefreshEnv +## set desktop wallpaper +#Invoke-WebRequest -Uri 'http://chocolateyfest.com/wp-content/uploads/2018/05/img-bg-front-page-header-NO_logo-opt.jpg' -Method Get -ContentType image/jpeg -OutFile 'C:\github\chocofest.jpg' +#Set-ItemProperty -path 'HKCU:\Control Panel\Desktop\' -name wallpaper -value 'C:\github\chocofest.jpg' +#rundll32.exe user32.dll, UpdatePerUserSystemParameters +#RefreshEnv Enable-UAC Enable-MicrosoftUpdate diff --git a/scripts/BasicApplications.ps1 b/scripts/BasicApplications.ps1 new file mode 100644 index 00000000..37e41adf --- /dev/null +++ b/scripts/BasicApplications.ps1 @@ -0,0 +1,62 @@ + +# Common +choco install -y 7zip +choco install -y notepadplusplus +choco install -y sumatrapdf + +# Browsers +choco install -y googlechrome +choco install -y firefox +choco install -y tor-browser + +# Media +choco install -y vlc +choco install -y audacity +choco install -y imageglass +choco install -y qbittorrent + + +# Management +choco install -y treesizefree +choco install -y crystaldiskinfo + +# Research sysinternals more +choco install -y sysinternals + +# Networking +choco install -y nordvpn + +# Dev +choco install -y git +choco install -y microsoft-windows-terminal +choco install -y putty +# For managing Linux and MacOS systems +choco install -y powershell-core + +# --- Maybe --- +# choco install -y autohotkey +# choco install -y docker-desktop +# choco install -y virtualbox + +# All Media Related +# choco install -y handbrake +# choco install -y makemkv +# choco install -y imgburn +# choco install -y filebot +# choco install -y bulkrenameutility + +# I normally just use the browser extension +# choco install -y bitwarden + +# --- Install Manually --- +# BackBlaze +# Winbox +# TP-Link Easy Config + +# --- Not Found --- +# gitbash +# magic jellybean keyfinder + + + + diff --git a/scripts/Browsers.ps1 b/scripts/Browsers.ps1 deleted file mode 100644 index 2ab3b689..00000000 --- a/scripts/Browsers.ps1 +++ /dev/null @@ -1,3 +0,0 @@ -#--- Browsers --- -choco install -y googlechrome -choco install -y firefox diff --git a/scripts/CommonDevTools.ps1 b/scripts/CommonDevTools.ps1 index 2275bc01..a189610e 100644 --- a/scripts/CommonDevTools.ps1 +++ b/scripts/CommonDevTools.ps1 @@ -1,7 +1,7 @@ - -# tools we expect devs across many scenarios will want -choco install -y vscode -choco install -y git --package-parameters="'/GitAndUnixToolsOnPath /WindowsTerminal'" -choco install -y python -choco install -y 7zip.install -choco install -y sysinternals + +# tools we expect devs across many scenarios will want +choco install -y vscode +choco install -y git --package-parameters="'/GitAndUnixToolsOnPath /WindowsTerminal'" +choco install -y python +choco install -y 7zip.install +choco install -y sysinternals diff --git a/scripts/Docker.ps1 b/scripts/Docker.ps1 deleted file mode 100644 index c2e7bbdd..00000000 --- a/scripts/Docker.ps1 +++ /dev/null @@ -1,4 +0,0 @@ -Enable-WindowsOptionalFeature -Online -FeatureName containers -All -RefreshEnv -choco install -y docker-for-windows -choco install -y vscode-docker diff --git a/scripts/FileExplorerSettings.ps1 b/scripts/FileExplorerSettings.ps1 index 9e06fa47..5515d1fc 100644 --- a/scripts/FileExplorerSettings.ps1 +++ b/scripts/FileExplorerSettings.ps1 @@ -1,15 +1,93 @@ + +#Example Provided: + #--- Configuring Windows properties --- #--- Windows Features --- # Show hidden files, Show protected OS files, Show file extensions -Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions +#Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions #--- File Explorer Settings --- # will expand explorer to the actual folder you're in -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 NavPaneExpandToCurrentFolder -Value 1 #adds things back in your left pane like recycle bin -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 NavPaneShowAllFolders -Value 1 #opens PC to This PC, not quick access -Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name LaunchTo -Value 1 +#Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name LaunchTo -Value 1 #taskbar where window is open for multi-monitor -Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name MMTaskbarMode -Value 2 +#Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name MMTaskbarMode -Value 2 + +############################# +# Explorer +############################# + +Write-Host "Configuring Explorer..." -ForegroundColor "Yellow" + +# Prerequisite: Ensure necessary registry paths +if (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer")) {New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Type Folder | Out-Null} +if (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState")) {New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState" -Type Folder | Out-Null} +if (!(Test-Path "HKLM:\Software\Policies\Microsoft\Windows\Windows Search")) {New-Item -Path "HKLM:\Software\Policies\Microsoft\Windows\Windows Search" -Type Folder | Out-Null} + +# Explorer: Show hidden files by default: Show Files: 1, Hide Files: 2 +Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "Hidden" 1 + +# Explorer: Show file extensions by default: Hide: 1, Show: 0 +Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "HideFileExt" 0 + +# Explorer: Show path in title bar: Hide: 0, Show: 1 +Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState" "FullPath" 0 + +# Explorer: Disable Quick Access: Recent Files +Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShowRecent -Type DWord -Value 0 + +# Explorer: Quick Access: Frequent Folders +Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer -Name ShowFrequent -Type DWord -Value 0 + +# Explorer: Expand explorer to the actual folder you're in +Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name NavPaneExpandToCurrentFolder -Value 1 + +# Explorer: Adds things back in your left pane like recycle bin +Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name NavPaneShowAllFolders -Value 1 + +# Explorer: Set Explorer view to This PC +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "LaunchTo" -Type DWord -Value 1 + +# Explorer: Hide Music icon in This PC +Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3dfdf296-dbec-4fb4-81d1-6a3438bcf4de}" -Recurse -ErrorAction SilentlyContinue +Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{1CF1260C-4DD0-4ebb-811F-33C572699FDE}" -Recurse -ErrorAction SilentlyContinue + +# Explorer: Hide Music in Explorer +Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{a0c69a99-21c8-4671-8703-7934162fcf1d}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide" +Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{a0c69a99-21c8-4671-8703-7934162fcf1d}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide" + +# Explorer: Hide Videos from This PC +Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}" -Recurse -ErrorAction SilentlyContinue +Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A0953C92-50DC-43bf-BE83-3742FED03C9C}" -Recurse -ErrorAction SilentlyContinue + +# Explorer: Hide Videos from Explorer +Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide" +Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide" + +# Explorer: Hide 3D Objects from This PC +Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}" -Recurse -ErrorAction SilentlyContinue + +# Explorer: Hide 3D Objects from Explorer +If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag")) { + New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag" -Force | Out-Null +} +Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide" +If (!(Test-Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag")) { + New-Item -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag" -Force | Out-Null +} +Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{31C0DD25-9439-4F12-BF41-7FF4EDA38722}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide" + +# Explorer: Disable Recycle Bin Delete Confirmation Dialog: Enable: 1, Disable: 0 +Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" "ConfirmFileDelete" 1 + +# Explorer: Show File Operation details +If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager")) { + New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager" | Out-Null +} +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\OperationStatusManager" -Name "EnthusiastMode" -Type DWord -Value 1 + + diff --git a/scripts/GeneralSettings.ps1 b/scripts/GeneralSettings.ps1 new file mode 100644 index 00000000..2058a273 --- /dev/null +++ b/scripts/GeneralSettings.ps1 @@ -0,0 +1,99 @@ + +############################# +# General Settings +############################# + +Write-Host "Configuring General Settings..." -ForegroundColor "Yellow" + +# General: Disable Sticky Keys +Set-ItemProperty -Path "HKCU:\Control Panel\Accessibility\StickyKeys" -Name "Flags" -Type String -Value "506" + +# General: Enable NumLock After Startup +If (!(Test-Path "HKU:")) { + New-PSDrive -Name HKU -PSProvider Registry -Root HKEY_USERS | Out-Null +} +Set-ItemProperty -Path "HKU:\.DEFAULT\Control Panel\Keyboard" -Name "InitialKeyboardIndicators" -Type DWord -Value 2147483650 +Add-Type -AssemblyName System.Windows.Forms +If (!([System.Windows.Forms.Control]::IsKeyLocked('NumLock'))) { + $wsh = New-Object -ComObject WScript.Shell + $wsh.SendKeys('{NUMLOCK}') +} + +# General: Permanently Delete Edge Shortcut From Desktop +Write-Host "Removing Edge browser shortcut from desktop..." +If (!(Test-Path "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EdgeUpdate")) { + New-Item -Path "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EdgeUpdate" | Out-Null +} +Set-ItemProperty -Path "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EdgeUpdate" -Name "CreateDesktopShortcutDefault" -Type DWord -Value 0 + +# General: Windows should never ask for my feedback +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Siuf")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Siuf" -Type Folder | Out-Null} +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" "NumberOfSIUFInPeriod" 0 + +# General: Disable Autoplay +Write-Host "Disabling Autoplay..." +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers" -Name "DisableAutoplay" -Type DWord -Value 1 + +# General: Disable Shared Experiences +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CDP" -Name "RomeSdkChannelUserAuthzPolicy" -Type DWord -Value 0 + +# General: Show Task Manager Details +If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\TaskManager")) { + New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\TaskManager" -Force | Out-Null +} +$preferences = Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\TaskManager" -Name "Preferences" -ErrorAction SilentlyContinue +If (!($preferences)) { + $taskmgr = Start-Process -WindowStyle Hidden -FilePath taskmgr.exe -PassThru + While (!($preferences)) { + Start-Sleep -m 250 + $preferences = Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\TaskManager" -Name "Preferences" -ErrorAction SilentlyContinue + } + Stop-Process $taskmgr +} +$preferences.Preferences[28] = 0 +Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\TaskManager" -Name "Preferences" -Type Binary -Value $preferences.Preferences + +# General: Disable OneDrive +If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive")) { + New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" | Out-Null +} +Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" -Name "DisableFileSyncNGSC" -Type DWord -Value 1 + +# General: Disable Cortana +If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings")) { + New-Item -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Force | Out-Null +} +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy" -Type DWord -Value 0 +If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization")) { + New-Item -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Force | Out-Null +} +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitTextCollection" -Type DWord -Value 1 +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitInkCollection" -Type DWord -Value 1 +If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore")) { + New-Item -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Force | Out-Null +} +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Name "HarvestContacts" -Type DWord -Value 0 +If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search")) { + New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Force | Out-Null +} +Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "AllowCortana" -Type DWord -Value 0 + +## AndyA: I use these +# Remove Default Printers +# Remove-Printer -Name "Microsoft XPS Document Writer" -ErrorAction:SilentlyContinue +# Remove-Printer -Name "Microsoft Print to PDF" -ErrorAction:SilentlyContinue +# Remove-Printer -Name "Fax" -ErrorAction:SilentlyContinue +# +# Set-Checkpoint -CheckpointName $checkpoint -CheckpointValue 1 +# +# } +# +# function Remove-SystemBloat { +# $checkpoint = 'SystemBloat' +# $done = Get-Checkpoint -CheckpointName $checkpoint +# +# if ($done) { +# Write-BoxstarterMessage "$checkpoint is already removed" +# return +# } diff --git a/scripts/GetMLIDEAndTooling.ps1 b/scripts/GetMLIDEAndTooling.ps1 deleted file mode 100644 index 130d8093..00000000 --- a/scripts/GetMLIDEAndTooling.ps1 +++ /dev/null @@ -1,3 +0,0 @@ -# Using vscode as a default IDE -choco install -y vscode -choco install -y git --package-parameters="'/GitAndUnixToolsOnPath /WindowsTerminal'" diff --git a/scripts/GetUwpSamplesOffGithub.ps1 b/scripts/GetUwpSamplesOffGithub.ps1 deleted file mode 100644 index c8108541..00000000 --- a/scripts/GetUwpSamplesOffGithub.ps1 +++ /dev/null @@ -1,5 +0,0 @@ -Update-SessionEnvironment -cd $env:USERPROFILE\desktop -mkdir UwpSamples -cd UwpSamples -git clone https://github.com/Microsoft/Windows-universal-samples/ \ No newline at end of file diff --git a/scripts/LockScreenSettings.ps1 b/scripts/LockScreenSettings.ps1 new file mode 100644 index 00000000..d7c278ef --- /dev/null +++ b/scripts/LockScreenSettings.ps1 @@ -0,0 +1,26 @@ + +## AndyA: I like the lock screen background; might automate the background .jpg +############################# +# Lock Screen +############################# + +Write-Host "Configuring Lock Screen..." -ForegroundColor "Yellow" + +## Enable Custom Background on the Login / Lock Screen +## Background file: C:\someDirectory\someImage.jpg +## File Size Limit: 256Kb +# Set-ItemProperty "HKLM:\Software\Policies\Microsoft\Windows\Personalization" "LockScreenImage" "C:\someDirectory\someImage.jpg" + +# 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 Lock screen Spotlight - New backgrounds, tips, advertisements etc. +Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "RotatingLockScreenEnabled" -Type DWord -Value 0 +Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "RotatingLockScreenOverlayEnabled" -Type DWord -Value 0 +Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338387Enabled" -Type DWord -Value 0 diff --git a/scripts/PrivacySettings.ps1 b/scripts/PrivacySettings.ps1 new file mode 100644 index 00000000..5a69d90b --- /dev/null +++ b/scripts/PrivacySettings.ps1 @@ -0,0 +1,94 @@ + +############################# +# Privacy Settings +############################# + +Write-Host "Configuring Privacy..." -ForegroundColor "Yellow" + +Disable-BingSearch +Disable-GameBarTips + +# Privacy: Disable Telemetry +Write-Host "Disabling Telemetry..." +Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0 +Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0 +Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0 +Disable-ScheduledTask -TaskName "Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" | Out-Null +Disable-ScheduledTask -TaskName "Microsoft\Windows\Application Experience\ProgramDataUpdater" | Out-Null +Disable-ScheduledTask -TaskName "Microsoft\Windows\Autochk\Proxy" | Out-Null +Disable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience Improvement Program\Consolidator" | Out-Null +Disable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" | Out-Null +Disable-ScheduledTask -TaskName "Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector" | Out-Null + +# Privacy: Disable Advertising ID +If (!(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 +If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Privacy")) { + New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Privacy" | Out-Null +} +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Privacy" -Name "TailoredExperiencesWithDiagnosticDataEnabled" -Type DWord -Value 0 + +# Privacy: Disable App Suggestions +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "ContentDeliveryAllowed" -Type DWord -Value 0 +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "OemPreInstalledAppsEnabled" -Type DWord -Value 0 +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "PreInstalledAppsEnabled" -Type DWord -Value 0 +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "PreInstalledAppsEverEnabled" -Type DWord -Value 0 +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SilentInstalledAppsEnabled" -Type DWord -Value 0 +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338389Enabled" -Type DWord -Value 0 +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SystemPaneSuggestionsEnabled" -Type DWord -Value 0 +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338388Enabled" -Type DWord -Value 0 +If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent")) { + New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Force | Out-Null +} +Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name "DisableWindowsConsumerFeatures" -Type DWord -Value 1 + +# Privacy: Speech, Inking, & Typing: Stop "Getting to know me" +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\InputPersonalization" "RestrictImplicitTextCollection" 1 +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\InputPersonalization" "RestrictImplicitInkCollection" 1 +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" "HarvestContacts" 0 +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" "AcceptedPrivacyPolicy" 0 +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Speech_OneCore\Settings")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Speech_OneCore\Settings" -Type Folder | Out-Null} +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Speech_OneCore\Settings\OnlineSpeechPrivacy")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Speech_OneCore\Settings\OnlineSpeechPrivacy" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Speech_OneCore\Settings\OnlineSpeechPrivacy" "HasAccepted" 0 + +# Privacy: Disable Map Updates +Set-ItemProperty -Path "HKLM:\SYSTEM\Maps" -Name "AutoUpdateEnabled" -Type DWord -Value 0 + +# Privacy: Disable Location Tracking +Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" -Name "SensorPermissionState" -Type DWord -Value 0 +Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" -Name "Status" -Type DWord -Value 0 + +# Privacy: Disable Feedback +If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules")) { + New-Item -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Force | Out-Null +} +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Name "NumberOfSIUFInPeriod" -Type DWord -Value 0 +Disable-ScheduledTask -TaskName "Microsoft\Windows\Feedback\Siuf\DmClient" -ErrorAction SilentlyContinue | Out-Null +Disable-ScheduledTask -TaskName "Microsoft\Windows\Feedback\Siuf\DmClientOnScenarioDownload" -ErrorAction SilentlyContinue | Out-Null + +# Privacy: Disable Error Reporting +Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" -Name "Disabled" -Type DWord -Value 1 +Disable-ScheduledTask -TaskName "Microsoft\Windows\Windows Error Reporting\QueueReporting" | Out-Null + +# Privacy: Remove AutoLogger file and Restrict Directory +$autoLoggerDir = "$env:PROGRAMDATA\Microsoft\Diagnosis\ETLLogs\AutoLogger" +If (Test-Path "$autoLoggerDir\AutoLogger-Diagtrack-Listener.etl") { + Remove-Item -Path "$autoLoggerDir\AutoLogger-Diagtrack-Listener.etl" +} +icacls $autoLoggerDir /deny SYSTEM:`(OI`)`(CI`)F | Out-Null + +# Privacy: Disable Application launch tracking: Enable: 1, Disable: 0 +Set-ItemProperty "HKCU:\\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "Start-TrackProgs" 0 + +# Privacy: Disable Diagnostics Tracking Service +Stop-Service "DiagTrack" -WarningAction SilentlyContinue +Set-Service "DiagTrack" -StartupType Disabled + +# Privacy: Stop and disable WAP Push Service +Stop-Service "dmwappushservice" -WarningAction SilentlyContinue +Set-Service "dmwappushservice" -StartupType Disabled diff --git a/scripts/PythonMLTools.ps1 b/scripts/PythonMLTools.ps1 deleted file mode 100644 index ebbc648d..00000000 --- a/scripts/PythonMLTools.ps1 +++ /dev/null @@ -1,19 +0,0 @@ -# Install python -choco install -y python --version=3.5.4 - -# Refresh path -refreshenv - -# Update pip -python -m pip install --upgrade pip - -# Install ML related python packages through pip -pip install numpy -pip install scipy -pip install pandas -pip install matplotlib -pip install tensorflow -pip install keras - -# Get Visual Studio C++ Redistributables -choco install -y vcredist2015 diff --git a/scripts/RemoveDefaultApps.ps1 b/scripts/RemoveDefaultApps.ps1 index dbac156a..f98ee9fe 100644 --- a/scripts/RemoveDefaultApps.ps1 +++ b/scripts/RemoveDefaultApps.ps1 @@ -1,69 +1,196 @@ + +# Work in Progress... + +############################################################################### +### Remove Default Applications # +############################################################################### + #--- Uninstall unnecessary applications that come with Windows out of the box --- Write-Host "Uninstall some applications that come with Windows out of the box" -ForegroundColor "Yellow" -#Referenced to build script -# https://docs.microsoft.com/en-us/windows/application-management/remove-provisioned-apps-during-update -# https://github.com/jayharris/dotfiles-windows/blob/master/windows.ps1#L157 -# https://gist.github.com/jessfraz/7c319b046daa101a4aaef937a20ff41f -# https://gist.github.com/alirobe/7f3b34ad89a159e6daa1 -# https://github.com/W4RH4WK/Debloat-Windows-10/blob/master/scripts/remove-default-apps.ps1 - -function removeApp { - Param ([string]$appName) - Write-Output "Trying to remove $appName" - Get-AppxPackage $appName -AllUsers | Remove-AppxPackage - Get-AppXProvisionedPackage -Online | Where DisplayName -like $appName | Remove-AppxProvisionedPackage -Online -} - -$applicationList = @( - "Microsoft.BingFinance" - "Microsoft.3DBuilder" - "Microsoft.BingNews" - "Microsoft.BingSports" - "Microsoft.BingWeather" - "Microsoft.CommsPhone" - "Microsoft.Getstarted" - "Microsoft.WindowsMaps" - "*MarchofEmpires*" - "Microsoft.GetHelp" - "Microsoft.Messaging" - "*Minecraft*" - "Microsoft.MicrosoftOfficeHub" - "Microsoft.OneConnect" - "Microsoft.WindowsPhone" - "Microsoft.WindowsSoundRecorder" - "*Solitaire*" - "Microsoft.MicrosoftStickyNotes" - "Microsoft.Office.Sway" - "Microsoft.XboxApp" - "Microsoft.XboxIdentityProvider" - "Microsoft.XboxGameOverlay" - "Microsoft.XboxGamingOverlay" - "Microsoft.ZuneMusic" - "Microsoft.ZuneVideo" - "Microsoft.NetworkSpeedTest" - "Microsoft.FreshPaint" - "Microsoft.Print3D" - "Microsoft.People*" - "Microsoft.Microsoft3DViewer" - "Microsoft.MixedReality.Portal*" - "*Skype*" - "*Autodesk*" - "*BubbleWitch*" - "king.com*" - "G5*" - "*Dell*" - "*Facebook*" - "*Keeper*" - "*Netflix*" - "*Twitter*" - "*Plex*" - "*.Duolingo-LearnLanguagesforFree" - "*.EclipseManager" - "ActiproSoftwareLLC.562882FEEB491" # Code Writer - "*.AdobePhotoshopExpress" -); - -foreach ($app in $applicationList) { - removeApp $app -} +# Uninstall 3D Builder +Get-AppxPackage "Microsoft.3DBuilder" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.3DBuilder" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Adobe Creative Cloud Express +Get-AppxPackage "AdobeSystemsIncorporated.AdobeCreativeCloudExpress" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "AdobeSystemsIncorporated.AdobeCreativeCloudExpress" | Remove-AppxProvisionedPackage -Online -AllUsers + +## Uninstall Alarms and Clock +#Get-AppxPackage "Microsoft.WindowsAlarms" -AllUsers | Remove-AppxPackage -AllUsers +#Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.WindowsAlarms" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Amazon Prime Video +Get-AppxPackage "AmazonVideo.PrimeVideo" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "AmazonVideo.PrimeVideo" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Autodesk Sketchbook +Get-AppxPackage "*.AutodeskSketchBook" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "*.AutodeskSketchBook" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Bing Finance +Get-AppxPackage "Microsoft.BingFinance" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.BingFinance" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Bing News +Get-AppxPackage "Microsoft.BingNews" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.BingNews" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Bing Sports +Get-AppxPackage "Microsoft.BingSports" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.BingSports" | Remove-AppxProvisionedPackage -Online -AllUsers + +## Uninstall Bing Weather +#Get-AppxPackage "Microsoft.BingWeather" -AllUsers | Remove-AppxPackage -AllUsers +#Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.BingWeather" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Bubble Witch 3 Saga +Get-AppxPackage "king.com.BubbleWitch3Saga" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "king.com.BubbleWitch3Saga" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Calendar and Mail +Get-AppxPackage "Microsoft.WindowsCommunicationsApps" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.WindowsCommunicationsApps" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Candy Crush Soda Saga +Get-AppxPackage "king.com.CandyCrushSodaSaga" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "king.com.CandyCrushSodaSaga" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall ClipChamp Video Editor +Get-AppxPackage "Clipchamp.Clipchamp" -AllUsers | Remove-AppxPackage +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Clipchamp.Clipchamp" | Remove-AppxProvisionedPackage -Online + +# Uninstall Cortana +Get-AppxPackage "Microsoft.549981C3F5F10" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.549981C3F5F10" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Disney+ +Get-AppxPackage "Disney.37853FC22B2CE" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Disney.37853FC22B2CE" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Disney Magic Kingdoms +Get-AppxPackage "*.DisneyMagicKingdoms" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "*.DisneyMagicKingdoms" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Dolby +Get-AppxPackage "DolbyLaboratories.DolbyAccess" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "DolbyLaboratories.DolbyAccess" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Facebook +Get-AppxPackage "Facebook.Facebook*" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Facebook.Facebook*" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Get Office, and it's "Get Office365" notifications +Get-AppxPackage "Microsoft.MicrosoftOfficeHub" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.MicrosoftOfficeHub" | Remove-AppxProvisionedPackage -Online -AllUsers + +## AndyA: Custom +# Uninstall Nicrosoft Feedback Hub +Get-AppxPackage "Microsoft.WindowsFeedbackHub" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.WindowsFeedbackHub" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Instagram +Get-AppxPackage "Facebook.Instagram*" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Facebook.Instagram*" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Maps +Get-AppxPackage "Microsoft.WindowsMaps" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.WindowsMaps" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall March of Empires +Get-AppxPackage "*.MarchofEmpires" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "*.MarchofEmpires" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Messaging +Get-AppxPackage "Microsoft.Messaging" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.Messaging" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Mobile Plans +Get-AppxPackage "Microsoft.OneConnect" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.OneConnect" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall OneNote +Get-AppxPackage "Microsoft.Office.OneNote" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.Office.OneNote" | Remove-AppxProvisionedPackage -Online -AllUsers + +## Uninstall Paint +#Get-AppxPackage "Microsoft.Paint" -AllUsers | Remove-AppxPackage -AllUsers +#Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.Paint" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall People +Get-AppxPackage "Microsoft.People" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.People" | Remove-AppxProvisionedPackage -Online -AllUsers + +## Uninstall Photos +#Get-AppxPackage "Microsoft.Windows.Photos" -AllUsers | Remove-AppxPackage -AllUsers +#Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.Windows.Photos" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Print3D +Get-AppxPackage "Microsoft.Print3D" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.Print3D" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Skype +Get-AppxPackage "Microsoft.SkypeApp" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.SkypeApp" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall SlingTV +Get-AppxPackage "*.SlingTV" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "*.SlingTV" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Solitaire +Get-AppxPackage "Microsoft.MicrosoftSolitaireCollection" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.MicrosoftSolitaireCollection" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Spotify +Get-AppxPackage "SpotifyAB.SpotifyMusic" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "SpotifyAB.SpotifyMusic" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall StickyNotes +Get-AppxPackage "Microsoft.MicrosoftStickyNotes" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.MicrosoftStickyNotes" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Sway +Get-AppxPackage "Microsoft.Office.Sway" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.Office.Sway" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall TikTok +Get-AppxPackage "*.TikTok" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "*.TikTok" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Microsoft ToDos +Get-AppxPackage "Microsoft.ToDos" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.ToDos" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Twitter +Get-AppxPackage "*.Twitter" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "*.Twitter" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Voice Recorder +Get-AppxPackage "Microsoft.WindowsSoundRecorder" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.WindowsSoundRecorder" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall XBox +Get-AppxPackage "Microsoft.XboxGamingOverlay" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppxPackage "Microsoft.GamingApp" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.XboxGamingOverlay" | Remove-AppxProvisionedPackage -Online -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.GamingApp" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Your Phone +Get-AppxPackage "Microsoft.YourPhone" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.YourPhone" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Zune Music (Groove) +Get-AppxPackage "Microsoft.ZuneMusic" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.ZuneMusic" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Zune Video +Get-AppxPackage "Microsoft.ZuneVideo" -AllUsers | Remove-AppxPackage -AllUsers +Get-AppXProvisionedPackage -Online | Where DisplayName -like "Microsoft.ZuneVideo" | Remove-AppxProvisionedPackage -Online -AllUsers + +# Uninstall Windows Media Player +Disable-WindowsOptionalFeature -Online -FeatureName "WindowsMediaPlayer" -NoRestart -WarningAction SilentlyContinue | Out-Null + +# Prevent "Suggested Applications" from returning +#Set-ItemProperty "HKLM:\Software\Policies\Microsoft\Windows\CloudContent" "DisableWindowsConsumerFeatures" 1 -Force +#Set-ItemProperty "HKLM:\Software\Policies\Microsoft\Windows\CloudContent" "DisableCloudOptimizedContent" 1 -Force +#Set-ItemProperty "HKLM:\Software\Policies\Microsoft\Windows\CloudContent" "DisableConsumerAccountStateContent" 1 -Force diff --git a/scripts/SecuritySettings.ps1 b/scripts/SecuritySettings.ps1 new file mode 100644 index 00000000..e59f6d3f --- /dev/null +++ b/scripts/SecuritySettings.ps1 @@ -0,0 +1,53 @@ + +############################# +# Security Settings +############################# + +Write-Host "Configuring Security..." -ForegroundColor "Yellow" + +# Security: Set the current network as Private +Get-NetConnectionProfile | Set-NetConnectionProfile -NetworkCategory Private + +# Security: Disable Remote Assistance +Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Remote Assistance" -Name "fAllowToGetHelp" -Type DWord -Value 0 + +# Security: Disable Remote Desktop +Write-Host "Disabling Remote Desktop..." +Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server" -Name "fDenyTSConnections" -Type DWord -Value 1 +Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name "UserAuthentication" -Type DWord -Value 1 + +# Security: Disable SMBv1 +Disable-WindowsOptionalFeature -Online -FeatureName smb1protocol + +# Security: Restrict Windows P2P downloads to local network +If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config")) { + New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" | Out-Null +} +Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 1 +If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization")) { + New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization" | Out-Null +} +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization" -Name "SystemSettingsDownloadMode" -Type DWord -Value 3 + +# Security: Don't let apps share and sync with non-explicitly-paired wireless devices over uPnP: Allow, Deny +if (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\bluetoothSync")) {New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\bluetoothSync" -Type Folder | Out-Null} +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\bluetoothSync" "Value" "Deny" + +# Security: Disable Windows Update Automatic Restart +Write-Host "Disabling Windows Update Automatic Restart..." +If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU")) { + New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Force | Out-Null +} +Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoRebootWithLoggedOnUsers" -Type DWord -Value 1 +Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUPowerManagement" -Type DWord -Value 0 + +# Security: Disable Windows Update "Schedule Restart" Notifications +Write-Host "Change Windows Updates to disable 'Notify to schedule restart'" +If (-not (Test-Path "HKCU:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings")) { + New-Item -Path HKCU:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings -Force | Out-Null +} +Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings -Name UxOption -Type DWord -Value 0 +If (-not (Test-Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings")) { + New-Item -Path HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings -Force | Out-Null +} +Set-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings -Name UxOption -Type DWord -Value 0 diff --git a/scripts/StartMenuSettings.ps1 b/scripts/StartMenuSettings.ps1 new file mode 100644 index 00000000..8ddb5181 --- /dev/null +++ b/scripts/StartMenuSettings.ps1 @@ -0,0 +1,21 @@ + +############################# +# Start Menu +############################# + +Write-Host "Configuring Start Menu..." -ForegroundColor "Yellow" + +# Start Menu: Disable Fast Startup +Write-Host "Disabling Fast Startup..." +Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Power" -Name "HiberbootEnabled" -Type DWord -Value 0 + +# Start Menu: Disable Web Search in Start Menu +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "BingSearchEnabled" -Type DWord -Value 0 + If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search")) { + New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Force | Out-Null + } + Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "DisableWebSearch" -Type DWord -Value 1 + +# Start Menu: Disable Cortana in Start Menu +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 diff --git a/scripts/TaskbarSettings.ps1 b/scripts/TaskbarSettings.ps1 new file mode 100644 index 00000000..f269d47d --- /dev/null +++ b/scripts/TaskbarSettings.ps1 @@ -0,0 +1,46 @@ + +############################# +# Taskbar +############################# + +Write-Host "Configuring Taskbar..." -ForegroundColor "Yellow" + +# Taskbar: Taskbar small, dock to bottom, always on +Set-BoxstarterTaskbarOptions -Size Small -Dock Bottom -Combine Full -AlwaysShowIconsOn + +# Taskbar: Taskbar where window is open for multi-monitor +Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name MMTaskbarMode -Value 2 + +## AndyA: I use widgets and search +# Taskbar: Hide the Search, Task, Widget, and Chat buttons: Show: 1, Hide: 0 +Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" "SearchboxTaskbarMode" 1 # Search +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "ShowTaskViewButton" 0 # Task +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "TaskbarDa" 1 # Widgets +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "TaskbarMn" 0 # Chat + +# Taskbar: Hide cortana: Hide: 0, Show: 1 +Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowCortanaButton -Value 0 +# Taskbar: Show TaskView: Hide: 0, Show: 1 +Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name ShowTaskViewButton -Value 0 + +# Taskbar: Show colors on Taskbar, Start, and SysTray: Disabled: 0, Taskbar, Start, & SysTray: 1, Taskbar Only: 2 +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" "ColorPrevalence" 1 + +# Titlebar: Disable theme colors on titlebar: Enable: 1, Disable: 0 +Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\DWM" "ColorPrevalence" 1 + +# Taskbar: Use the Windows 7-8.1 Style Volume Mixer +If (-Not (Test-Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\MTCUVC")) { + New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name MTCUVC | Out-Null +} +Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\MTCUVC" -Name EnableMtcUvc -Type DWord -Value 0 + +# Taskbar: 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 + +# Taskbar: 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 diff --git a/scripts/WiFiSettings.ps1 b/scripts/WiFiSettings.ps1 new file mode 100644 index 00000000..f1f8eff2 --- /dev/null +++ b/scripts/WiFiSettings.ps1 @@ -0,0 +1,24 @@ + +############################# +# WiFi Settings +############################# + +Write-Host "Configuring WiFi..." -ForegroundColor "Yellow" + +# Wifi: Disable HotSpot Reporting +If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting")) { + New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Force | Out-Null +} +Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Name "Value" -Type DWord -Value 0 + +# Wifi: Disable AutoConnect +Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" -Name "Value" -Type DWord -Value 0 + +# Wifi: Disable AutoConnectAllowedOEM +If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config")) { + New-Item -Path "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config" -Force | Out-Null +} +Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config" -Name "AutoConnectAllowedOEM" -Type Dword -Value 0 + +# Wifi: Disable WifiSense +Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config" -Name "WiFISenseAllowed" -Type Dword -Value 0 diff --git a/scripts/WindowsTemplateStudio.ps1 b/scripts/WindowsTemplateStudio.ps1 deleted file mode 100644 index 49132407..00000000 --- a/scripts/WindowsTemplateStudio.ps1 +++ /dev/null @@ -1,26 +0,0 @@ -# installing Windows Template Studio VSIX -Write-Host "Installing Windows Template Studio" -ForegroundColor "Yellow" - -$requestUri = "https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery"; -$requestBody = '{"flags":"262","filters":[{"criteria":[{"filterType":"10","value":"windows template studio"}],"sortBy":"0","sortOrder":"2","pageSize":"25","pageNumber":"1"}]}'; -$requestHeaders = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"; -$requestHeaders.Add('Accept','application/json; api-version=3.2-preview.1'); -$requestHeaders.Add('Content-Type','application/json; charset=utf-8'); - -$results = Invoke-WebRequest -Uri $requestUri -Method POST -Headers $requestHeaders -Body $requestBody -UseBasicParsing; - -$jsonResults = $results.Content | ConvertFrom-Json; -$wtsResults = $jsonResults.results[0].extensions | where {$_.extensionName -eq "WindowsTemplateStudio"} ; -$wtsFileUrl = $wtsResults.versions[0].files | where {$_.assetType -eq "Microsoft.Templates.2017.vsix"}; - -$wtsVsix = [System.IO.Path]::GetFileName($wtsFileUrl.source); -$wtsFullPath = [System.IO.Path]::Combine((Resolve-Path $env:USERPROFILE).path, $wtsVsix); - -Invoke-WebRequest -Uri $wtsFileUrl.source -OutFile $wtsFullPath; - -$vsixInstallerFile = Get-Childitem -Include vsixinstaller.exe -Recurse -Path "C:\Program Files (x86)\Microsoft Visual Studio\2017\"; -$wtsArgList = "/quiet `"$wtsFullPath`""; - -$vsixInstallerResult = Start-Process -FilePath $vsixInstallerFile.FullName -ArgumentList $wtsArgList -Wait -PassThru; - -Remove-Item $wtsFullPath \ No newline at end of file