added function Test-RegistryProperty
This commit is contained in:
+13
-1
@@ -1,8 +1,14 @@
|
||||
$ScheduleCheckDisk = $false
|
||||
|
||||
# Run the System File Checker to scan for and repair any problems with protected system files
|
||||
LogMsg "Running System File Checker"
|
||||
$SFCOutput = $(sfc /scannow) | Out-String
|
||||
LogMsg $SFCOutput
|
||||
|
||||
$SFCOutputWithSpaces = " W i n d o w s R e s o u r c e P r o t e c t i o n d i d n o t f i n d a n y i n t e g r i t y v i o l a t i o n s ."
|
||||
$SFCOutputWithoutSpaces = "Windows Resource Protection did not find any integrity violations."
|
||||
If ( !($SFCOutput -match $SFCOutputWithSpaces) -or !($SFCOutput -match $SFCOutputWithoutSpaces) ) { $ScheduleCheckDisk = $true }
|
||||
|
||||
# Run enhanced DISM for Windows 8 and higher endpoints
|
||||
If ( IsWindowsVersion -ge "6.2" )
|
||||
{
|
||||
@@ -26,4 +32,10 @@ If ( IsWindowsVersion -ge "6.2" )
|
||||
}
|
||||
LogMsg "Completed Windows Component Store log data collection"
|
||||
}
|
||||
Else { LogMsg "Online image cleanup and restoration is only supported on Windows 8 and higher" }
|
||||
Else { LogMsg "Online image cleanup and restoration is only supported on Windows 8 and higher" }
|
||||
|
||||
# Schedule Check Disk if needed
|
||||
If ( $ScheduleCheckDisk ) {
|
||||
LogMsg "Check Disk scheduled to repair disk at next boot"
|
||||
& echo y | chkdsk /F /R /X
|
||||
}
|
||||
Reference in New Issue
Block a user