forked from dokan-dev/dokany
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_ifstest.ps1
More file actions
29 lines (24 loc) · 958 Bytes
/
run_ifstest.ps1
File metadata and controls
29 lines (24 loc) · 958 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Set-StrictMode -Version 2
#TODO: Get Path via some MSI-CmdLet or Registry instead of hardcoding it
if (([Version]$((Get-CimInstance Win32_OperatingSystem).Version)).Major -eq 10) {
$hlk_path = "C:\Program Files (x86)\Windows Kits\10\Hardware Lab Kit"
}
else {
$hlk_path = "C:\Program Files (x86)\Windows Kits\8.1\Hardware Certification Kit"
}
$nttest_path = "${hlk_path}\Tests\${env:PROCESSOR_ARCHITECTURE}\NTTEST"
$ifstest_exe = "${nttest_path}\BASETEST\core_file_services\ifs_test_kit\ifstest.exe"
if (!(Test-Path $ifstest_exe)) {
throw "$ifstest_exe not found!"
}
#IFSTest does not return error for wrong param so we need to analyse stderr
& $ifstest_exe $args 2>&1 | tee -Variable allOutput
$stderr = $allOutput | ?{ $_ -is [System.Management.Automation.ErrorRecord] }
if ($stderr) {
Write-Error "IFSTest printed error"
Exit 1
}
if ($LASTEXITCODE -ne 0) {
Write-Error "Non-zero exit-code: $LASTEXITCODE"
Exit $LASTEXITCODE
}