Compare commits
2
Commits
5cd4e99465
...
9409f000e0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9409f000e0 | ||
|
|
0499a143ef |
@@ -1,5 +1,5 @@
|
|||||||
# Run SFC to check the filesystem, convert the result from Unicode to UTF8, delete the intermediate $tempFile
|
# 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
|
$(sfc.exe /scannow) | Out-File $tempFile
|
||||||
Set-Content -Path $tempFile -Value $(Get-Content -Path $tempFile -Encoding Unicode) -Encoding UTF8
|
Set-Content -Path $tempFile -Value $(Get-Content -Path $tempFile -Encoding Unicode) -Encoding UTF8
|
||||||
$SFCOutput = Get-Content -Path $tempFile
|
$SFCOutput = Get-Content -Path $tempFile
|
||||||
|
|||||||
@@ -269,6 +269,12 @@ Function IsWindowsBuild {
|
|||||||
# Get the path to the TEMP folder (context dependent)
|
# Get the path to the TEMP folder (context dependent)
|
||||||
Function Get-TempPath { Return [System.IO.Path]::GetTempPath() }
|
Function Get-TempPath { Return [System.IO.Path]::GetTempPath() }
|
||||||
|
|
||||||
|
# Get a random file name with random extension
|
||||||
|
Function Get-RandomFile { Return [System.IO.Path]::GetRandomFileName() }
|
||||||
|
|
||||||
|
# Get a random temp file in the current TEMP folder
|
||||||
|
Function Get-RandomTempFile { Return [System.IO.Path]::Combine($(Get-TempPath), $(Get-RandomFile)) }
|
||||||
|
|
||||||
# Determine if the system is 64-bit or not
|
# Determine if the system is 64-bit or not
|
||||||
Function Is64bit {
|
Function Is64bit {
|
||||||
switch ( $(Get-CimInstance -ClassName Win32_OperatingSystem -Property OSArchitecture | Select-Object -ExpandProperty OSArchitecture) )
|
switch ( $(Get-CimInstance -ClassName Win32_OperatingSystem -Property OSArchitecture | Select-Object -ExpandProperty OSArchitecture) )
|
||||||
|
|||||||
Reference in New Issue
Block a user