Fix ?
This commit is contained in:
parent
2520b18ebe
commit
6e7a6cc6f4
|
|
@ -740,13 +740,36 @@ try {
|
|||
Write-Section $writer 'SYSTEM FILE CHECK - VERIFY ONLY' {
|
||||
if ($isAdmin) {
|
||||
'[RUNNING] sfc.exe /verifyonly'
|
||||
sfc.exe /verifyonly
|
||||
|
||||
$tempSfc = Join-Path $env:TEMP (
|
||||
'winreport_sfc_' +
|
||||
[guid]::NewGuid().ToString('N') +
|
||||
'.txt'
|
||||
)
|
||||
|
||||
try {
|
||||
cmd.exe /c "sfc.exe /verifyonly > `"$tempSfc`" 2>&1"
|
||||
|
||||
if (Test-Path $tempSfc) {
|
||||
$bytes = [System.IO.File]::ReadAllBytes($tempSfc)
|
||||
|
||||
# SFC output is commonly UTF-16LE
|
||||
$text = [System.Text.Encoding]::Unicode.GetString($bytes)
|
||||
|
||||
$text.Trim([char]0)
|
||||
}
|
||||
else {
|
||||
'SFC output file was not created.'
|
||||
}
|
||||
}
|
||||
finally {
|
||||
Remove-Item $tempSfc -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
}
|
||||
else {
|
||||
'Skipped: sfc /verifyonly requires an elevated session.'
|
||||
}
|
||||
}
|
||||
|
||||
Write-Section $writer 'IMPORTANT DIRECTORIES' {
|
||||
$programFilesX86 = [Environment]::GetEnvironmentVariable('ProgramFiles(x86)')
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue