Created
January 8, 2020 07:36
-
-
Save jonimattila/d34c1ec74ffb7dc99bd6326ae8929e05 to your computer and use it in GitHub Desktop.
This file contains 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
Start-Process -FilePath "${env:Windir}\System32\SFC.EXE" -ArgumentList '/scannow' -Wait -Verb RunAs | |
Repair-WindowsImage -Online -scanhealth | |
Repair-WindowsImage -Online -checkhealth | |
if ($ComputerProperties = Repair-WindowsImage -Online -checkhealth | Select-Object ImageHealthState | Where-Object {($_.ImageHealthState -notlike "Healthy")}) { | |
Repair-WindowsImage -Online -RestoreHealth} | |
Start-Process -FilePath "${env:Windir}\System32\SFC.EXE" -ArgumentList '/scannow' -Wait -Verb RunAs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment