# Copyright © 2008, Microsoft Corporation. All rights reserved. #TS_HardwareDevice Import-LocalizedData -BindingVariable localizationString -FileName CL_LocalizationData #================================================================================ # Loading Utilities #================================================================================ . .\CL_DetectingDevice.ps1 . .\CL_Utility.ps1 #================================================================================ # Initializing Troubleshooter #================================================================================ #================================================================================ # Checking for Pending System Reboot. #================================================================================ $IsRebootneeded = .\TS_PendingRestart.ps1 if($IsRebootneeded -eq $True) { Return } # Collecting Device IDs passed by Audio Troubleshooter [String]$SelectResult = "None" try { $SelectResult = Get-DiagInput -id "IT_SelectDevice" -ErrorAction SilentlyContinue } catch { $SelectResult = "None" } if ($SelectResult -eq "ScanOnly") { .\TS_RescanAllDevices.ps1 return } $DriverProblem = $false $PNPDeviceArray = $Null $HashRootCausesTable = $Null if($SelectResult -ne "None") { $PNPDeviceArray = $SelectResult.Split("#") $HashRootCausesTable = New-Object System.Collections.HashTable foreach ($DeviceID in $PNPDeviceArray) { if (-not [String]::IsNullOrEmpty($DeviceID)) { $HashRootCausesTable.Add($DeviceID, $DeviceID) } } } else { $HashRootCausesTable = DetectingDeviceFromPnPEntity } #================================================================================ # Checking for Root Causes #================================================================================ foreach($DeviceID in $HashRootCausesTable.Values) { $IsDriverNotFound = .\TS_DriverNotFound.ps1 $DeviceID if($IsDriverNotFound -eq $True) { $DriverProblem = $true continue } $IsDisabled = .\TS_DeviceDisabled.ps1 $DeviceID if($IsDisabled -eq $True) { continue } $IsDriverNeedUpdated = .\TS_DriverNeedUpdated.ps1 $DeviceID if($IsDriverNeedUpdated -eq $True) { $DriverProblem = $true continue } $IsNotWorkProperly = .\TS_NotWorkProperly.ps1 $DeviceID } if (($SelectResult -eq "None") -or ($DriverProblem -eq $true)) { .\TS_CheckDriversOnInstall.ps1 } if($SelectResult -eq "None") { .\TS_RescanAllDevices.ps1 }