diff --git a/Fix-WindowsHealth.ps1 b/Fix-WindowsHealth.ps1 index 107adaa..02eede1 100644 --- a/Fix-WindowsHealth.ps1 +++ b/Fix-WindowsHealth.ps1 @@ -1,5 +1,5 @@ # Run SFC to check the filesystem, convert the result from Unicode to UTF8, delete the intermediate $tempFile -$tempFile = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), [System.IO.Path]::GetRandomFileName()) +$tempFile = Get-RandomTempFile $(sfc.exe /scannow) | Out-File $tempFile Set-Content -Path $tempFile -Value $(Get-Content -Path $tempFile -Encoding Unicode) -Encoding UTF8 $SFCOutput = Get-Content -Path $tempFile