Guest User

Untitled

a guest
Nov 20th, 2017
454
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. cls
  2. Import-Module C:\rig\admin\rigger\DeviceManagement\DeviceManagement.psd1 –Verbose
  3. #Get-Device | Sort-Object -Property Name | ft Name, DriverVersion, DriverProvider, IsPresent, HasProblem -AutoSize
  4. #Get-Device | Sort-Object -Property Name | ft Name, LocationInfo, DriverVersion, DriverProvider, IsPresent, HasProblem, Class -AutoSize
  5. #Get-device | where {$_.LocationInfo -like '*PCI bus*' } | select Name, LocationInfo, UINumber
  6. #get-device | where {$_.Name -like '*PCI Express Root Port*' } | select Name,LocationInfo,UINumber
  7. #get-device | where { $_.AvailableProperties['DEVPKEY_Device_Class'] -eq 'Display' } | % { $_.AvailableProperties['DEVPKEY_Device_BiosDeviceName'] }
  8. #Get-device | where { $_.Name -like '*PCI Express*' } | % { $_.AvailableProperties }
  9. #Get-device | where { $_.AvailableProperties['DEVPKEY_Device_InstanceId'] -like 'ACPI\PNP0A08*' } | % { $_.AvailableProperties['DEVPKEY_NAME'] }
  10. #Get-device | where { $_.AvailableProperties['DEVPKEY_Device_DriverInfSection'] -like '*PCI_ROOT*' } | % { $_.AvailableProperties }
  11. #Get-device | where { $_.AvailableProperties['DEVPKEY_Device_InstanceId'] -like 'ACPI_HAL\PNP0C08*' } | % { $_.AvailableProperties }
  12. #Get-device | where { $_.AvailableProperties['DEVPKEY_Device_InstanceId'] -like 'ROOT\ACPI_HAL*' } | % { $_.AvailableProperties }
  13.  
  14. write-host 'PCI_ROOT children'
  15. $pci_roots = Get-device | where { $_.AvailableProperties['DEVPKEY_Device_DriverInfSection'] -like '*PCI_ROOT*' }
  16. foreach($pci_root in $pci_roots) {
  17.     foreach($child_id in $pci_root.AvailableProperties['DEVPKEY_Device_Children']) {
  18.         $pci_child = get-device | where { $_.AvailableProperties['DEVPKEY_Device_InstanceId'] -eq $child_id -and $_.Service -eq 'pci' }
  19.         if($pci_child.AvailableProperties.Count -gt 0) {
  20.             write-host '>' $pci_child.AvailableProperties['DEVPKEY_Device_BiosDeviceName']
  21.             $like_comp = '{0}.*' -f ($pci_child.AvailableProperties['DEVPKEY_Device_BiosDeviceName'] -replace '\x00','')
  22.             $on_bus = get-device | where { $_.AvailableProperties['DEVPKEY_Device_BiosDeviceName'] -like $like_comp }
  23.             if($on_bus.Count -gt 0) {
  24.                 foreach($bus_device in $on_bus) {
  25.                     write-host '   ->['$bus_device.AvailableProperties['DEVPKEY_Device_Class']'] [ProblemCode:'$bus_device.AvailableProperties['DEVPKEY_Device_ProblemCode']'] ' $bus_device.Name '@' $bus_device.LocationInfo
  26.                 }
  27.             } else { write-host '   <nothing here>' }
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment