From eea70e48f97fed34367087edaff4f1968a61a1e9 Mon Sep 17 00:00:00 2001 From: Richard Newton Date: Mon, 25 Feb 2019 18:37:48 -0800 Subject: [PATCH] Added option to install .NET 3.5 Prompt 7 when debloating will now ask if you want to install .NET 3.5. --- Windows10Debloater.ps1 | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Windows10Debloater.ps1 b/Windows10Debloater.ps1 index 66668d8..cb9cd58 100644 --- a/Windows10Debloater.ps1 +++ b/Windows10Debloater.ps1 @@ -659,6 +659,7 @@ $EdgePdf2 = "Do you want to revert changes that disabled Edge as the default PDF $Reboot = "For some of the changes to properly take effect it is recommended to reboot your machine. Would you like to restart?" $OneDriveDelete = "Do you want to uninstall One Drive?" $Unpin = "Do you want to unpin all items from the Start menu?" +$InstallNET = "Do you want to install .NET 3.5?" $Prompt1 = [Windows.MessageBox]::Show($Ask, "Debloat or Revert", $Button, $ErrorIco) Switch ($Prompt1) { #This will debloat Windows 10 @@ -769,9 +770,21 @@ Switch ($Prompt1) { } } - #Prompt asking if you'd like to reboot your machine - $Prompt6 = [Windows.MessageBox]::Show($Reboot, "Reboot", $Button, $Warn) + $Prompt6 = [Windows.MessageBox]::Show($InstallNET, "Install .Net", $Button, $Warn) Switch ($Prompt6) { + Yes { + Write-Output "Initializing the installation of .NET 3.5..." + Try { + DISM /Online /Enable-Feature /FeatureName:NetFx3 /All + Write-Output ".NET 3.5 has been successfully installed!" } + Catch { + $_ + } + } + } + #Prompt asking if you'd like to reboot your machine + $Prompt7 = [Windows.MessageBox]::Show($Reboot, "Reboot", $Button, $Warn) + Switch ($Prompt7) { Yes { Write-Output "Unloading the HKCR drive..." Remove-PSDrive HKCR