Advertisement
Guest User

hwckeck.ps1

a guest
Jun 7th, 2021
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $deviceList = @{
  2.     GPU_IrisXe = "PCI\VEN_8086&DEV_9A4";
  3.     TouchPanel = "HID\GDIX1002";
  4.     TouchPanel_Driver = "ACPI\GDIX1002";
  5.     WiFi_AX200 = "PCI\VEN_8086&DEV_2723";
  6.     SoundCard = "INTELAUDIO\FUNC_01&VEN_10EC&DEV_0269&SUBSYS_12970000";
  7.     Fingerprint = "ACPI\FTE3600";
  8. }
  9. $cpuVariants = "i7-1165G7", "i5-1135G7"
  10. $contactAdress = "[email protected]"
  11.  
  12. ###############################################################################
  13. # Do not change anything below this line
  14. ###############################################################################
  15.  
  16. $requiredCPU = $cpuVariants | Out-GridView -OutputMode Single -Title "Select CPU Variant"
  17.  
  18. $mismatches = 0
  19.  
  20. if($cpuVariants.Contains($requiredCPU)) {
  21.     $cpuInfo = Get-PnpDevice -FriendlyName "*$($requiredCPU)*"
  22.    
  23.     if(($cpuInfo | measure).Count -gt 0) {
  24.         Write-Host -ForegroundColor Green "[ OK ] CPU (Intel $($requiredCPU))"
  25.     } else {
  26.         $mismatches++
  27.         Write-Host -ForegroundColor Red "[MISS] CPU (Intel $($requiredCPU))"
  28.     }
  29. } else {
  30.     Write-Host -ForegroundColor Red "[ERRO] Invalid CPU model selected."
  31.     exit
  32. }
  33.  
  34. $connectedDevices = Get-PnpDevice | Select -ExpandProperty DeviceID
  35.  
  36. foreach($device in $deviceList.GetEnumerator()) {
  37.     $match = $false
  38.    
  39.     foreach($cDev in $connectedDevices) {
  40.         if($cDev.StartsWith($device.Value)) {
  41.             $match = $true
  42.            
  43.             break
  44.         }
  45.     }
  46.    
  47.     if($match) {
  48.         Write-Host -ForegroundColor Green "[ OK ] $($device.Key) ($($device.Value))"
  49.     } else {
  50.         $mismatches++
  51.         Write-Host -ForegroundColor Red "[MISS] $($device.Key) ($($device.Value))"
  52.     }
  53. }
  54.  
  55. if($mismatches -gt 0) {
  56.     Write-Host -ForegroundColor Red "`n`nThe installed hardware is not correct or defective!"
  57.     Write-Host -ForegroundColor Red "Contact $($contactAdress)"
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement