22 Commits
3.8 ... 3.9

Author SHA1 Message Date
Disassembler
e3f790adae v3.9, 2020-04-02
- Add "Uninstall OpenSSH Client" (thx @TheRandomLabs)
- Add "Install OpenSSH Server" (thx @TheRandomLabs)
- Add "Enable Developer Mode" (thx @RobDesideri)
- Add "Disable Automatic Restart Sign-on" (thx @Dvorak-Stepan)
- Add "Uninstall Windows Hello Face"
- Add "Uninstall Math Recognizer"
- Add "Uninstall PowerShell Integrated Scripting Environment"
- Update a bunch of tweaks to be compatible with 2004 and "N" editions
- Update bloatware removal tweaks
- Update or clarify comments for tweaks possibly breaking interoperability in some scenarios
2020-04-02 11:33:01 +02:00
Disassembler
7d59f5b45c Don't autostart OpenSSH Server without letting user configure it first 2020-04-02 01:44:53 +02:00
Disassembler
a56893cb29 Add "Uninstall PowerShell Integrated Scripting Environment" 2020-04-02 01:43:57 +02:00
Disassembler
09247748bf Add "Uninstall Math Recognizer" 2020-04-02 01:43:26 +02:00
Disassembler
fa4583001f Add "Uninstall Windows Hello Face" 2020-04-02 01:42:54 +02:00
Disassembler
2f391ca8b5 Change method of installing capabilities and optional features
- Adds compatibility with 2004
- Adds compatibility with "N" editions
2020-04-02 01:40:50 +02:00
Disassembler
5036244ccb Update UninstallFaxAndScan for 2004 2020-04-01 23:55:59 +02:00
Disassembler
785c8ab362 Remove "DisableWindowsConsumerFeatures" from "DisableAppSuggestions", resolves #278 2020-04-01 23:46:40 +02:00
Disassembler
6cc2176797 Disable even more suggestions 2020-04-01 23:26:03 +02:00
Disassembler
5a66227109 Fix Start menu search on 2004, closes #298 (thx @mariobesen) 2020-03-31 16:14:10 +02:00
Disassembler
ffacb062b8 Add 2004 / 20H1 / 19041 to Windows version overview 2020-03-31 13:48:49 +02:00
Disassembler
e3fa432605 Add warning for EnableCIMemoryIntegrity, reformat a few other notes
No functional changes
2020-02-10 16:06:56 +01:00
Disassembler
5372078195 Revert "Add Lenovo AppxPackage bloatware (#89)", tryfix for #293 2020-01-27 07:53:27 +01:00
Disassembler
68f94a968c Clarify note for SetDEPOptOut/SetDEPOptIn, resolves #7 2020-01-20 00:00:32 +01:00
Disassembler
d854b60ab3 Add "Disable Automatic Restart Sign-on", closes #289 2020-01-16 20:42:27 +01:00
Disassembler
070fd66257 Add "Enable Developer Mode", closes #279 2020-01-16 19:40:13 +01:00
Disassembler
233d519a45 Update note for EnableDotNetStrongCrypto, closes #291 2020-01-16 13:37:14 +01:00
w1zk1d
f7963ebc86 Added king.com.FarmHeroesSaga to UninstallThirdPartyBloat (#290) 2020-01-15 14:14:48 +01:00
Disassembler
317c490389 Add note about possible Windows Store delivery optimization issues, closes #281 2019-11-24 09:18:30 +01:00
Disassembler
6d48ba8f2a Add "Uninstall OpenSSH Client" and "Install OpenSSH Server", closes #275 2019-11-23 22:54:31 +01:00
Disassembler
f55a4eb239 Add notes about Microsoft Intune, closes #270, closes #271 2019-11-23 22:00:59 +01:00
Disassembler
1fd558cf44 Add 1909 to build overview 2019-11-01 03:48:17 +01:00
4 changed files with 160 additions and 55 deletions

View File

@@ -1,7 +1,7 @@
##########
# Win 10 / Server 2016 / Server 2019 Initial Setup Script - Default preset
# Author: Disassembler <disassembler@dasm.cz>
# Version: v3.8, 2019-09-11
# Version: v3.9, 2020-04-02
# Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
##########
@@ -82,6 +82,7 @@ EnableUpdateMSProducts # DisableUpdateMSProducts
# DisableUpdateAutoDownload # EnableUpdateAutoDownload
DisableUpdateRestart # EnableUpdateRestart
DisableMaintenanceWakeUp # EnableMaintenanceWakeUp
# DisableAutoRestartSignOn # EnableAutoRestartSignOn
DisableSharedExperiences # EnableSharedExperiences
# EnableClipboardHistory # DisableClipboardHistory
DisableAutoplay # EnableAutoplay
@@ -199,12 +200,18 @@ DisableEdgeShortcutCreation # EnableEdgeShortcutCreation
DisableIEFirstRun # EnableIEFirstRun
DisableFirstLogonAnimation # EnableFirstLogonAnimation
DisableMediaSharing # EnableMediaSharing
# EnableDeveloperMode # DisableDeveloperMode
# UninstallMediaPlayer # InstallMediaPlayer
# UninstallInternetExplorer # InstallInternetExplorer
# UninstallWorkFolders # InstallWorkFolders
# UninstallHelloFace # InstallHelloFace
# UninstallMathRecognizer # InstallMathRecognizer
# UninstallPowerShellV2 # InstallPowerShellV2
# UninstallPowerShellISE # InstallPowerShellISE
# InstallLinuxSubsystem # UninstallLinuxSubsystem
# InstallHyperV # UninstallHyperV
# UninstallSSHClient # InstallSSHClient
# InstallSSHServer # UninstallSSHServer
# InstallNET23 # UninstallNET23
SetPhotoViewerAssociation # UnsetPhotoViewerAssociation
AddPhotoViewerOpenWith # RemovePhotoViewerOpenWith

View File

@@ -45,7 +45,7 @@ The script supports command line options and parameters which can help you custo
**Q:** Did you test the script?
**A:** Yes. I'm testing new additions on up-to-date 64bit Home and Enterprise editions in VMs. I'm also regularly using it for all my home installations after all bigger updates.
**Q**: I've run the script and it did something I don't like, how can I undo it?
**Q:** I've run the script and it did something I don't like, how can I undo it?
**A:** For every tweak, there is also a corresponding function which restores the default settings. The default is considered freshly installed Windows 10 or Windows Server 2016 with no adjustments made during or after the installation. Use the tweaks to create and run new preset. Alternatively, since some functions are just automation for actions which can be done using GUI, find appropriate control and modify it manually.
**Q:** I've run the script and some controls are now greyed out and display message "*Some settings are hidden or managed by your organization*", why?
@@ -83,6 +83,8 @@ The script supports command line options and parameters which can help you custo
| 1803 | Redstone 4 (RS4) | April 2018 Update | 17134 |
| 1809 | Redstone 5 (RS5) | October 2018 Update | 17763 |
| 1903 | 19H1 | May 2019 Update | 18362 |
| 1909 | 19H2 | November 2019 Update | 18363 |
| 2004 | 20H1 | TBA | 19041 |
&nbsp;

View File

@@ -1,7 +1,7 @@
##########
# Win 10 / Server 2016 / Server 2019 Initial Setup Script - Main execution loop
# Author: Disassembler <disassembler@dasm.cz>
# Version: v3.8, 2019-09-11
# Version: v3.9, 2020-04-02
# Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
##########

View File

@@ -1,7 +1,7 @@
##########
# Win 10 / Server 2016 / Server 2019 Initial Setup Script - Tweak library
# Author: Disassembler <disassembler@dasm.cz>
# Version: v3.8, 2019-09-11
# Version: v3.9, 2020-04-02
# Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
##########
@@ -10,7 +10,7 @@
##########
# Disable Telemetry
# Note: This tweak also disables the possibility to join Windows Insider Program, as it requires Telemetry data.
# Note: This tweak also disables the possibility to join Windows Insider Program and breaks Microsoft Intune enrollment/deployment, as these feaures require Telemetry data.
# Windows Update control panel may show message "Your device is at risk because it's out of date and missing important security and quality updates. Let's get you back on track so Windows can run more securely. Select this button to get going".
# In such case, enable telemetry, run Windows update and then disable telemetry again.
# See also https://github.com/Disassembler0/Win10-Initial-Setup-Script/issues/57 and https://github.com/Disassembler0/Win10-Initial-Setup-Script/issues/92
@@ -165,10 +165,10 @@ Function DisableAppSuggestions {
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-353696Enabled" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-353698Enabled" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SystemPaneSuggestionsEnabled" -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
If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\UserProfileEngagement")) {
New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\UserProfileEngagement" -Force | Out-Null
}
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name "DisableWindowsConsumerFeatures" -Type DWord -Value 1
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\UserProfileEngagement" -Name "ScoobeSystemSettingEnabled" -Type DWord -Value 0
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace")) {
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace" -Force | Out-Null
}
@@ -199,11 +199,12 @@ Function EnableAppSuggestions {
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338387Enabled" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338393Enabled" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-353698Enabled" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent" -Name "DisableWindowsConsumerFeatures" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\UserProfileEngagement" -Name "ScoobeSystemSettingEnabled" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace" -Name "AllowSuggestedAppsInWindowsInkWorkspace" -ErrorAction SilentlyContinue
}
# Disable Activity History feed in Task View - Note: The checkbox "Let Windows collect my activities from this PC" remains checked even when the function is disabled
# Disable Activity History feed in Task View
# Note: The checkbox "Let Windows collect my activities from this PC" remains checked even when the function is disabled
Function DisableActivityHistory {
Write-Output "Disabling Activity History..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\System" -Name "EnableActivityFeed" -Type DWord -Value 0
@@ -220,10 +221,15 @@ Function EnableActivityHistory {
}
# Disable Background application access - ie. if apps can download or update when they aren't used
# Cortana is excluded as its inclusion breaks start menu search, ShellExperience host breaks toasts and notifications
# Cortana (resp. Search since 2004) is excluded as its inclusion breaks start menu search, ShellExperienceHost breaks toasts and notifications
Function DisableBackgroundApps {
Write-Output "Disabling Background application access..."
Get-ChildItem -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" -Exclude "Microsoft.Windows.Cortana*","Microsoft.Windows.ShellExperienceHost*" | ForEach-Object {
If ([System.Environment]::OSVersion.Version.Build -ge 19041) {
$exclude = "Microsoft.Windows.Search*", "Microsoft.Windows.ShellExperienceHost*"
} Else {
$exclude = "Microsoft.Windows.Cortana*", "Microsoft.Windows.ShellExperienceHost*"
}
Get-ChildItem -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" -Exclude $exclude | ForEach-Object {
Set-ItemProperty -Path $_.PsPath -Name "Disabled" -Type DWord -Value 1
Set-ItemProperty -Path $_.PsPath -Name "DisabledByUser" -Type DWord -Value 1
}
@@ -483,6 +489,7 @@ Function SetP2PUpdateInternet {
}
# Disable Windows Update P2P delivery optimization completely
# Warning: Completely disabling delivery optimization can break Windows Store downloads - see https://github.com/Disassembler0/Win10-Initial-Setup-Script/issues/281
Function SetP2PUpdateDisable {
Write-Output "Disabling Windows Update P2P optimization..."
If ([System.Environment]::OSVersion.Version.Build -eq 10240) {
@@ -515,6 +522,7 @@ Function EnableDiagTrack {
}
# Stop and disable Device Management Wireless Application Protocol (WAP) Push Service
# Note: This service is needed for Microsoft Intune interoperability
Function DisableWAPPush {
Write-Output "Stopping and disabling Device Management WAP Push Service..."
Stop-Service "dmwappushservice" -WarningAction SilentlyContinue
@@ -708,6 +716,8 @@ Function DisableCtrldFolderAccess {
}
# Enable Core Isolation Memory Integrity - Part of Windows Defender System Guard virtualization-based security - Applicable since 1803
# Warning: This may cause old applications and drivers to crash or even cause BSOD
# Problems were confirmed with old video drivers (Intel HD Graphics for 2nd gen., Radeon HD 6850), and old antivirus software (Kaspersky Endpoint Security 10.2, 11.2)
Function EnableCIMemoryIntegrity {
Write-Output "Enabling Core Isolation Memory Integrity..."
If (!(Test-Path "HKLM:\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity")) {
@@ -777,15 +787,15 @@ Function EnableScriptHost {
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Script Host\Settings" -Name "Enabled" -ErrorAction SilentlyContinue
}
# Enable strong cryptography for .NET Framework (version 4 and above)
# https://stackoverflow.com/questions/36265534/invoke-webrequest-ssl-fails
# Enable strong cryptography for old versions of .NET Framework (4.6 and newer have strong crypto enabled by default)
# https://docs.microsoft.com/en-us/dotnet/framework/network-programming/tls#schusestrongcrypto
Function EnableDotNetStrongCrypto {
Write-output "Enabling .NET strong cryptography..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\.NETFramework\v4.0.30319" -Name "SchUseStrongCrypto" -Type DWord -Value 1
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319" -Name "SchUseStrongCrypto" -Type DWord -Value 1
}
# Disable strong cryptography for .NET Framework (version 4 and above)
# Disable strong cryptography for old versions of .NET Framework
Function DisableDotNetStrongCrypto {
Write-output "Disabling .NET strong cryptography..."
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\.NETFramework\v4.0.30319" -Name "SchUseStrongCrypto" -ErrorAction SilentlyContinue
@@ -851,13 +861,13 @@ Function EnableRecoveryAndReset {
reagentc /enable 2>&1 | Out-Null
}
# Set Data Execution Prevention (DEP) policy to OptOut (Turn on DEP for all programs and services except selected)
# Set Data Execution Prevention (DEP) policy to OptOut - Turn on DEP for all 32-bit applications except manually excluded. 64-bit applications have DEP always on.
Function SetDEPOptOut {
Write-Output "Setting Data Execution Prevention (DEP) policy to OptOut..."
bcdedit /set `{current`} nx OptOut | Out-Null
}
# Set Data Execution Prevention (DEP) policy to OptIn (Turn on DEP for essential Windows programs and services only)
# Set Data Execution Prevention (DEP) policy to OptIn - Turn on DEP only for essential 32-bit Windows executables and manually included applications. 64-bit applications have DEP always on.
Function SetDEPOptIn {
Write-Output "Setting Data Execution Prevention (DEP) policy to OptIn..."
bcdedit /set `{current`} nx OptIn | Out-Null
@@ -1095,12 +1105,14 @@ Function EnableConnectionSharing {
Function DisableRemoteAssistance {
Write-Output "Disabling Remote Assistance..."
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Remote Assistance" -Name "fAllowToGetHelp" -Type DWord -Value 0
Get-WindowsCapability -Online | Where-Object { $_.Name -like "App.Support.QuickAssist*" } | Remove-WindowsCapability -Online | Out-Null
}
# Enable Remote Assistance - Not applicable to Server (unless Remote Assistance is explicitly installed)
Function EnableRemoteAssistance {
Write-Output "Enabling Remote Assistance..."
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Remote Assistance" -Name "fAllowToGetHelp" -Type DWord -Value 1
Get-WindowsCapability -Online | Where-Object { $_.Name -like "App.Support.QuickAssist*" } | Add-WindowsCapability -Online | Out-Null
}
# Enable Remote Desktop
@@ -1236,6 +1248,19 @@ Function EnableMaintenanceWakeUp {
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\Maintenance" -Name "WakeUp" -ErrorAction SilentlyContinue
}
# Disable Automatic Restart Sign-on - Applicable since 1903
# See https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/winlogon-automatic-restart-sign-on--arso-
Function DisableAutoRestartSignOn {
Write-Output "Disabling Automatic Restart Sign-on..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "DisableAutomaticRestartSignOn" -Type DWord -Value 1
}
# Enable Automatic Restart Sign-on - Applicable since 1903
Function EnableAutoRestartSignOn {
Write-Output "Enabling Automatic Restart Sign-on..."
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "DisableAutomaticRestartSignOn" -ErrorAction SilentlyContinue
}
# Disable Shared Experiences - Applicable since 1703. Not applicable to Server
# This setting can be set also via GPO, however doing so causes reset of Start Menu cache. See https://github.com/Disassembler0/Win10-Initial-Setup-Script/issues/145 for details
Function DisableSharedExperiences {
@@ -3032,7 +3057,6 @@ function UninstallThirdPartyBloat {
Get-AppxPackage "DB6EA5DB.CyberLinkMediaSuiteEssentials" | Remove-AppxPackage
Get-AppxPackage "DolbyLaboratories.DolbyAccess" | Remove-AppxPackage
Get-AppxPackage "Drawboard.DrawboardPDF" | Remove-AppxPackage
Get-AppxPackage "E046963F.LenovoCompanion" | Remove-AppxPackage
Get-AppxPackage "Facebook.Facebook" | Remove-AppxPackage
Get-AppxPackage "Fitbit.FitbitCoach" | Remove-AppxPackage
Get-AppxPackage "flaregamesGmbH.RoyalRevolt2" | Remove-AppxPackage
@@ -3042,8 +3066,7 @@ function UninstallThirdPartyBloat {
Get-AppxPackage "king.com.CandyCrushFriends" | Remove-AppxPackage
Get-AppxPackage "king.com.CandyCrushSaga" | Remove-AppxPackage
Get-AppxPackage "king.com.CandyCrushSodaSaga" | Remove-AppxPackage
Get-AppxPackage "LenovoCorporation.LenovoID" | Remove-AppxPackage
Get-AppxPackage "LenovoCorporation.LenovoSettings" | Remove-AppxPackage
Get-AppxPackage "king.com.FarmHeroesSaga" | Remove-AppxPackage
Get-AppxPackage "Nordcurrent.CookingFever" | Remove-AppxPackage
Get-AppxPackage "PandoraMediaInc.29680B314EFC2" | Remove-AppxPackage
Get-AppxPackage "PricelinePartnerNetwork.Booking.comBigsavingsonhot" | Remove-AppxPackage
@@ -3082,7 +3105,6 @@ Function InstallThirdPartyBloat {
Get-AppxPackage -AllUsers "DB6EA5DB.CyberLinkMediaSuiteEssentials" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Get-AppxPackage -AllUsers "DolbyLaboratories.DolbyAccess" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Get-AppxPackage -AllUsers "Drawboard.DrawboardPDF" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Get-AppxPackage -AllUsers "E046963F.LenovoCompanion" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Get-AppxPackage -AllUsers "Facebook.Facebook" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Get-AppxPackage -AllUsers "Fitbit.FitbitCoach" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Get-AppxPackage -AllUsers "flaregamesGmbH.RoyalRevolt2" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
@@ -3092,8 +3114,7 @@ Function InstallThirdPartyBloat {
Get-AppxPackage -AllUsers "king.com.CandyCrushFriends" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Get-AppxPackage -AllUsers "king.com.CandyCrushSaga" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Get-AppxPackage -AllUsers "king.com.CandyCrushSodaSaga" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Get-AppxPackage -AllUsers "LenovoCorporation.LenovoID" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Get-AppxPackage -AllUsers "LenovoCorporation.LenovoSettings" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Get-AppxPackage -AllUsers "king.com.FarmHeroesSaga" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Get-AppxPackage -AllUsers "Nordcurrent.CookingFever" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Get-AppxPackage -AllUsers "PandoraMediaInc.29680B314EFC2" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
Get-AppxPackage -AllUsers "PricelinePartnerNetwork.Booking.comBigsavingsonhot" | ForEach-Object {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
@@ -3264,49 +3285,91 @@ Function EnableMediaSharing {
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\WindowsMediaPlayer" -Name "PreventLibrarySharing" -ErrorAction SilentlyContinue
}
# Enable Developer Mode
Function EnableDeveloperMode {
Write-Output "Enabling Developer Mode..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" -Name "AllowDevelopmentWithoutDevLicense" -Type DWord -Value 1
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" -Name "AllowAllTrustedApps" -Type DWord -Value 1
}
# Disable Developer Mode
Function DisableDeveloperMode {
Write-Output "Disabling Developer Mode..."
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" -Name "AllowDevelopmentWithoutDevLicense" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" -Name "AllowAllTrustedApps" -ErrorAction SilentlyContinue
}
# Uninstall Windows Media Player
Function UninstallMediaPlayer {
Write-Output "Uninstalling Windows Media Player..."
Disable-WindowsOptionalFeature -Online -FeatureName "WindowsMediaPlayer" -NoRestart -WarningAction SilentlyContinue | Out-Null
Get-WindowsOptionalFeature -Online | Where-Object { $_.FeatureName -eq "WindowsMediaPlayer" } | Disable-WindowsOptionalFeature -Online -NoRestart -WarningAction SilentlyContinue | Out-Null
Get-WindowsCapability -Online | Where-Object { $_.Name -like "Media.WindowsMediaPlayer*" } | Remove-WindowsCapability -Online | Out-Null
}
# Install Windows Media Player
Function InstallMediaPlayer {
Write-Output "Installing Windows Media Player..."
Enable-WindowsOptionalFeature -Online -FeatureName "WindowsMediaPlayer" -NoRestart -WarningAction SilentlyContinue | Out-Null
Get-WindowsOptionalFeature -Online | Where-Object { $_.FeatureName -eq "WindowsMediaPlayer" } | Enable-WindowsOptionalFeature -Online -NoRestart -WarningAction SilentlyContinue | Out-Null
Get-WindowsCapability -Online | Where-Object { $_.Name -like "Media.WindowsMediaPlayer*" } | Add-WindowsCapability -Online | Out-Null
}
# Uninstall Internet Explorer
Function UninstallInternetExplorer {
Write-Output "Uninstalling Internet Explorer..."
Disable-WindowsOptionalFeature -Online -FeatureName "Internet-Explorer-Optional-$env:PROCESSOR_ARCHITECTURE" -NoRestart -WarningAction SilentlyContinue | Out-Null
Get-WindowsOptionalFeature -Online | Where-Object { $_.FeatureName -like "Internet-Explorer-Optional*" } | Disable-WindowsOptionalFeature -Online -NoRestart -WarningAction SilentlyContinue | Out-Null
Get-WindowsCapability -Online | Where-Object { $_.Name -like "Browser.InternetExplorer*" } | Remove-WindowsCapability -Online | Out-Null
}
# Install Internet Explorer
Function InstallInternetExplorer {
Write-Output "Installing Internet Explorer..."
Enable-WindowsOptionalFeature -Online -FeatureName "Internet-Explorer-Optional-$env:PROCESSOR_ARCHITECTURE" -NoRestart -WarningAction SilentlyContinue | Out-Null
Get-WindowsOptionalFeature -Online | Where-Object { $_.FeatureName -like "Internet-Explorer-Optional*" } | Enable-WindowsOptionalFeature -Online -NoRestart -WarningAction SilentlyContinue | Out-Null
Get-WindowsCapability -Online | Where-Object { $_.Name -like "Browser.InternetExplorer*" } | Add-WindowsCapability -Online | Out-Null
}
# Uninstall Work Folders Client - Not applicable to Server
Function UninstallWorkFolders {
Write-Output "Uninstalling Work Folders Client..."
Disable-WindowsOptionalFeature -Online -FeatureName "WorkFolders-Client" -NoRestart -WarningAction SilentlyContinue | Out-Null
Get-WindowsOptionalFeature -Online | Where-Object { $_.FeatureName -eq "WorkFolders-Client" } | Disable-WindowsOptionalFeature -Online -NoRestart -WarningAction SilentlyContinue | Out-Null
}
# Install Work Folders Client - Not applicable to Server
Function InstallWorkFolders {
Write-Output "Installing Work Folders Client..."
Enable-WindowsOptionalFeature -Online -FeatureName "WorkFolders-Client" -NoRestart -WarningAction SilentlyContinue | Out-Null
Get-WindowsOptionalFeature -Online | Where-Object { $_.FeatureName -eq "WorkFolders-Client" } | Enable-WindowsOptionalFeature -Online -NoRestart -WarningAction SilentlyContinue | Out-Null
}
# Uninstall PowerShell 2.0 Environment.
# Uninstall Windows Hello Face - Not applicable to Server
Function UninstallHelloFace {
Write-Output "Uninstalling Windows Hello Face..."
Get-WindowsCapability -Online | Where-Object { $_.Name -like "Hello.Face*" } | Remove-WindowsCapability -Online | Out-Null
}
# Install Windows Hello Face - Not applicable to Server
Function InstallHelloFace {
Write-Output "Installing Windows Hello Face..."
Get-WindowsCapability -Online | Where-Object { $_.Name -like "Hello.Face*" } | Add-WindowsCapability -Online | Out-Null
}
# Uninstall Math Recognizer - Not applicable to Server
Function UninstallMathRecognizer {
Write-Output "Uninstalling Math Recognizer..."
Get-WindowsCapability -Online | Where-Object { $_.Name -like "MathRecognizer*" } | Remove-WindowsCapability -Online | Out-Null
}
# Install Math Recognizer - Not applicable to Server
Function InstallMathRecognizer {
Write-Output "Installing Math Recognizer..."
Get-WindowsCapability -Online | Where-Object { $_.Name -like "MathRecognizer*" } | Add-WindowsCapability -Online | Out-Null
}
# Uninstall PowerShell 2.0 Environment
# PowerShell 2.0 is deprecated since September 2018. This doesn't affect PowerShell 5 or newer which is the default PowerShell environment.
# May affect Microsoft Diagnostic Tool and possibly other scripts. See https://blogs.msdn.microsoft.com/powershell/2017/08/24/windows-powershell-2-0-deprecation/
Function UninstallPowerShellV2 {
Write-Output "Uninstalling PowerShell 2.0 Environment..."
If ((Get-CimInstance -Class "Win32_OperatingSystem").ProductType -eq 1) {
Disable-WindowsOptionalFeature -Online -FeatureName "MicrosoftWindowsPowerShellV2Root" -NoRestart -WarningAction SilentlyContinue | Out-Null
Get-WindowsOptionalFeature -Online | Where-Object { $_.FeatureName -eq "MicrosoftWindowsPowerShellV2Root" } | Disable-WindowsOptionalFeature -Online -NoRestart -WarningAction SilentlyContinue | Out-Null
} Else {
Uninstall-WindowsFeature -Name "PowerShell-V2" -WarningAction SilentlyContinue | Out-Null
}
@@ -3316,39 +3379,44 @@ Function UninstallPowerShellV2 {
Function InstallPowerShellV2 {
Write-Output "Installing PowerShell 2.0 Environment..."
If ((Get-CimInstance -Class "Win32_OperatingSystem").ProductType -eq 1) {
Enable-WindowsOptionalFeature -Online -FeatureName "MicrosoftWindowsPowerShellV2Root" -NoRestart -WarningAction SilentlyContinue | Out-Null
Get-WindowsOptionalFeature -Online | Where-Object { $_.FeatureName -eq "MicrosoftWindowsPowerShellV2Root" } | Enable-WindowsOptionalFeature -Online -NoRestart -WarningAction SilentlyContinue | Out-Null
} Else {
Install-WindowsFeature -Name "PowerShell-V2" -WarningAction SilentlyContinue | Out-Null
}
}
# Uninstall PowerShell Integrated Scripting Environment - Applicable since 2004
# Note: Also removes built-in graphical methods like Out-GridView
Function UninstallPowerShellISE {
Write-Output "Uninstalling PowerShell Integrated Scripting Environment..."
Get-WindowsCapability -Online | Where-Object { $_.Name -like "Microsoft.Windows.PowerShell.ISE*" } | Remove-WindowsCapability -Online | Out-Null
}
# Install PowerShell Integrated Scripting Environment - Applicable since 2004
Function InstallPowerShellISE {
Write-Output "Installing PowerShell Integrated Scripting Environment..."
Get-WindowsCapability -Online | Where-Object { $_.Name -like "Microsoft.Windows.PowerShell.ISE*" } | Add-WindowsCapability -Online | Out-Null
}
# Install Linux Subsystem - Applicable since Win10 1607 and Server 1709
# Note: 1607 requires also EnableDevelopmentMode for WSL to work
# For automated Linux distribution installation, see https://docs.microsoft.com/en-us/windows/wsl/install-on-server
Function InstallLinuxSubsystem {
Write-Output "Installing Linux Subsystem..."
If ([System.Environment]::OSVersion.Version.Build -eq 14393) {
# 1607 needs developer mode to be enabled
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" -Name "AllowDevelopmentWithoutDevLicense" -Type DWord -Value 1
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" -Name "AllowAllTrustedApps" -Type DWord -Value 1
}
Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Windows-Subsystem-Linux" -NoRestart -WarningAction SilentlyContinue | Out-Null
Get-WindowsOptionalFeature -Online | Where-Object { $_.FeatureName -eq "Microsoft-Windows-Subsystem-Linux" } | Enable-WindowsOptionalFeature -Online -NoRestart -WarningAction SilentlyContinue | Out-Null
}
# Uninstall Linux Subsystem - Applicable since Win10 1607 and Server 1709
Function UninstallLinuxSubsystem {
Write-Output "Uninstalling Linux Subsystem..."
If ([System.Environment]::OSVersion.Version.Build -eq 14393) {
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" -Name "AllowDevelopmentWithoutDevLicense" -Type DWord -Value 0
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" -Name "AllowAllTrustedApps" -Type DWord -Value 0
}
Disable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Windows-Subsystem-Linux" -NoRestart -WarningAction SilentlyContinue | Out-Null
Get-WindowsOptionalFeature -Online | Where-Object { $_.FeatureName -eq "Microsoft-Windows-Subsystem-Linux" } | Disable-WindowsOptionalFeature -Online -NoRestart -WarningAction SilentlyContinue | Out-Null
}
# Install Hyper-V - Not applicable to Home
Function InstallHyperV {
Write-Output "Installing Hyper-V..."
If ((Get-CimInstance -Class "Win32_OperatingSystem").ProductType -eq 1) {
Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Hyper-V-All" -NoRestart -WarningAction SilentlyContinue | Out-Null
Get-WindowsOptionalFeature -Online | Where-Object { $_.FeatureName -eq "Microsoft-Hyper-V-All" } | Enable-WindowsOptionalFeature -Online -NoRestart -WarningAction SilentlyContinue | Out-Null
} Else {
Install-WindowsFeature -Name "Hyper-V" -IncludeManagementTools -WarningAction SilentlyContinue | Out-Null
}
@@ -3358,17 +3426,41 @@ Function InstallHyperV {
Function UninstallHyperV {
Write-Output "Uninstalling Hyper-V..."
If ((Get-CimInstance -Class "Win32_OperatingSystem").ProductType -eq 1) {
Disable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Hyper-V-All" -NoRestart -WarningAction SilentlyContinue | Out-Null
Get-WindowsOptionalFeature -Online | Where-Object { $_.FeatureName -eq "Microsoft-Hyper-V-All" } | Disable-WindowsOptionalFeature -Online -NoRestart -WarningAction SilentlyContinue | Out-Null
} Else {
Uninstall-WindowsFeature -Name "Hyper-V" -IncludeManagementTools -WarningAction SilentlyContinue | Out-Null
}
}
# Uninstall OpenSSH Client - Applicable since 1803
Function UninstallSSHClient {
Write-Output "Uninstalling OpenSSH Client..."
Get-WindowsCapability -Online | Where-Object { $_.Name -like "OpenSSH.Client*" } | Remove-WindowsCapability -Online | Out-Null
}
# Install OpenSSH Client - Applicable since 1803
Function InstallSSHClient {
Write-Output "Installing OpenSSH Client..."
Get-WindowsCapability -Online | Where-Object { $_.Name -like "OpenSSH.Client*" } | Add-WindowsCapability -Online | Out-Null
}
# Install OpenSSH Server - Applicable since 1809
Function InstallSSHServer {
Write-Output "Installing OpenSSH Server..."
Get-WindowsCapability -Online | Where-Object { $_.Name -like "OpenSSH.Server*" } | Add-WindowsCapability -Online | Out-Null
}
# Uninstall OpenSSH Server - Applicable since 1809
Function UninstallSSHServer {
Write-Output "Uninstalling OpenSSH Server..."
Get-WindowsCapability -Online | Where-Object { $_.Name -like "OpenSSH.Server*" } | Remove-WindowsCapability -Online | Out-Null
}
# Install .NET Framework 2.0, 3.0 and 3.5 runtimes - Requires internet connection
Function InstallNET23 {
Write-Output "Installing .NET Framework 2.0, 3.0 and 3.5 runtimes..."
If ((Get-CimInstance -Class "Win32_OperatingSystem").ProductType -eq 1) {
Enable-WindowsOptionalFeature -Online -FeatureName "NetFx3" -NoRestart -WarningAction SilentlyContinue | Out-Null
Get-WindowsOptionalFeature -Online | Where-Object { $_.FeatureName -eq "NetFx3" } | Enable-WindowsOptionalFeature -Online -NoRestart -WarningAction SilentlyContinue | Out-Null
} Else {
Install-WindowsFeature -Name "NET-Framework-Core" -WarningAction SilentlyContinue | Out-Null
}
@@ -3378,7 +3470,7 @@ Function InstallNET23 {
Function UninstallNET23 {
Write-Output "Uninstalling .NET Framework 2.0, 3.0 and 3.5 runtimes..."
If ((Get-CimInstance -Class "Win32_OperatingSystem").ProductType -eq 1) {
Disable-WindowsOptionalFeature -Online -FeatureName "NetFx3" -NoRestart -WarningAction SilentlyContinue | Out-Null
Get-WindowsOptionalFeature -Online | Where-Object { $_.FeatureName -eq "NetFx3" } | Disable-WindowsOptionalFeature -Online -NoRestart -WarningAction SilentlyContinue | Out-Null
} Else {
Uninstall-WindowsFeature -Name "NET-Framework-Core" -WarningAction SilentlyContinue | Out-Null
}
@@ -3438,25 +3530,25 @@ Function RemovePhotoViewerOpenWith {
# Uninstall Microsoft Print to PDF
Function UninstallPDFPrinter {
Write-Output "Uninstalling Microsoft Print to PDF..."
Disable-WindowsOptionalFeature -Online -FeatureName "Printing-PrintToPDFServices-Features" -NoRestart -WarningAction SilentlyContinue | Out-Null
Get-WindowsOptionalFeature -Online | Where-Object { $_.FeatureName -eq "Printing-PrintToPDFServices-Features" } | Disable-WindowsOptionalFeature -Online -NoRestart -WarningAction SilentlyContinue | Out-Null
}
# Install Microsoft Print to PDF
Function InstallPDFPrinter {
Write-Output "Installing Microsoft Print to PDF..."
Enable-WindowsOptionalFeature -Online -FeatureName "Printing-PrintToPDFServices-Features" -NoRestart -WarningAction SilentlyContinue | Out-Null
Get-WindowsOptionalFeature -Online | Where-Object { $_.FeatureName -eq "Printing-PrintToPDFServices-Features" } | Enable-WindowsOptionalFeature -Online -NoRestart -WarningAction SilentlyContinue | Out-Null
}
# Uninstall Microsoft XPS Document Writer
Function UninstallXPSPrinter {
Write-Output "Uninstalling Microsoft XPS Document Writer..."
Disable-WindowsOptionalFeature -Online -FeatureName "Printing-XPSServices-Features" -NoRestart -WarningAction SilentlyContinue | Out-Null
Get-WindowsOptionalFeature -Online | Where-Object { $_.FeatureName -eq "Printing-XPSServices-Features" } | Disable-WindowsOptionalFeature -Online -NoRestart -WarningAction SilentlyContinue | Out-Null
}
# Install Microsoft XPS Document Writer
Function InstallXPSPrinter {
Write-Output "Installing Microsoft XPS Document Writer..."
Enable-WindowsOptionalFeature -Online -FeatureName "Printing-XPSServices-Features" -NoRestart -WarningAction SilentlyContinue | Out-Null
Get-WindowsOptionalFeature -Online | Where-Object { $_.FeatureName -eq "Printing-XPSServices-Features" } | Enable-WindowsOptionalFeature -Online -NoRestart -WarningAction SilentlyContinue | Out-Null
}
# Remove Default Fax Printer
@@ -3474,13 +3566,15 @@ Function AddFaxPrinter {
# Uninstall Windows Fax and Scan Services - Not applicable to Server
Function UninstallFaxAndScan {
Write-Output "Uninstalling Windows Fax and Scan Services..."
Disable-WindowsOptionalFeature -Online -FeatureName "FaxServicesClientPackage" -NoRestart -WarningAction SilentlyContinue | Out-Null
Get-WindowsOptionalFeature -Online | Where-Object { $_.FeatureName -eq "FaxServicesClientPackage" } | Disable-WindowsOptionalFeature -Online -NoRestart -WarningAction SilentlyContinue | Out-Null
Get-WindowsCapability -Online | Where-Object { $_.Name -like "Print.Fax.Scan*" } | Remove-WindowsCapability -Online | Out-Null
}
# Install Windows Fax and Scan Services - Not applicable to Server
Function InstallFaxAndScan {
Write-Output "Installing Windows Fax and Scan Services..."
Enable-WindowsOptionalFeature -Online -FeatureName "FaxServicesClientPackage" -NoRestart -WarningAction SilentlyContinue | Out-Null
Get-WindowsOptionalFeature -Online | Where-Object { $_.FeatureName -eq "FaxServicesClientPackage" } | Enable-WindowsOptionalFeature -Online -NoRestart -WarningAction SilentlyContinue | Out-Null
Get-WindowsCapability -Online | Where-Object { $_.Name -like "Print.Fax.Scan*" } | Add-WindowsCapability -Online | Out-Null
}
##########
@@ -3593,7 +3687,8 @@ Function DisableAudio {
#region Unpinning
##########
# Unpin all Start Menu tiles - Note: This function has no counterpart. You have to pin the tiles back manually.
# Unpin all Start Menu tiles
# Note: This function has no counterpart. You have to pin the tiles back manually.
Function UnpinStartMenuTiles {
Write-Output "Unpinning all Start Menu tiles..."
If ([System.Environment]::OSVersion.Version.Build -ge 15063 -And [System.Environment]::OSVersion.Version.Build -le 16299) {
@@ -3610,7 +3705,8 @@ Function UnpinStartMenuTiles {
}
}
# Unpin all Taskbar icons - Note: This function has no counterpart. You have to pin the icons back manually.
# Unpin all Taskbar icons
# Note: This function has no counterpart. You have to pin the icons back manually.
Function UnpinTaskbarIcons {
Write-Output "Unpinning all Taskbar icons..."
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband" -Name "Favorites" -Type Binary -Value ([byte[]](255))