Created
January 8, 2020 07:36
-
-
Save jonimattila/d34c1ec74ffb7dc99bd6326ae8929e05 to your computer and use it in GitHub Desktop.
Revisions
-
jonimattila created this gist
Jan 8, 2020 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ 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