This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Requires -RunAsAdministrator | |
| Stop-Service -Name @("bits","wuauserv","appidsvc","cryptsvc") | |
| del "$env:ALLUSERSPROFILE\Application Data\Microsoft\Network\Downloader\qmgr*.*" | |
| if(Test-Path variable:global:errs) {Remove-Variable -Name @("errs") -ErrorAction SilentlyContinue } #$err = $null | |
| $errs = [System.Collections.ArrayList](@{}) | |
| function Start-Backup { | |
| param([string[]]$paths = @("$env:SystemRoot\system32\catroot2","$env:SystemRoot\SoftwareDistribution")) | |
| foreach($path in $paths){ | |
| $bak = "$($path).bak" | |
| if((Test-Path -PathType Any $bak) -and (Test-Path -PathType Any $path)){ |