Browse Source

Added CheckInstallService Function

Richard Newton 6 years ago
parent
commit
3c989503f0
1 changed files with 10 additions and 0 deletions
  1. 10 0
      Windows10DebloaterGUI.ps1

+ 10 - 0
Windows10DebloaterGUI.ps1

@@ -472,6 +472,14 @@ $RemoveAllBloatware.Add_Click( {
                 Start-Service -Name dmwappushservice 
             }
         }
+        
+        Function CheckInstallService {
+  
+            If (Get-Service -Name InstallService | Where-Object ($_.Status -eq "Stopped"}) {
+            Start-Service -Name InstallService
+            Set-Service -Name InstallService -StartupType Automatic 
+            }
+          }
   
         Write-Host "Initiating Sysprep"
         Begin-SysPrep
@@ -486,6 +494,8 @@ $RemoveAllBloatware.Add_Click( {
         Protect-Privacy
         #Write-Host "Stopping Edge from taking over as the default PDF Viewer."
         #Stop-EdgePDF
+        Write-Output "Setting the 'InstallService' Windows service back to "Started" and the Startup Type "Automatic".
+        CheckInstallService
         Write-Host "Finished all tasks. `n"
   
     } )