Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cls
- Import-Module C:\rig\admin\rigger\DeviceManagement\DeviceManagement.psd1 –Verbose
- #Get-Device | Sort-Object -Property Name | ft Name, DriverVersion, DriverProvider, IsPresent, HasProblem -AutoSize
- #Get-Device | Sort-Object -Property Name | ft Name, LocationInfo, DriverVersion, DriverProvider, IsPresent, HasProblem, Class -AutoSize
- #Get-device | where {$_.LocationInfo -like '*PCI bus*' } | select Name, LocationInfo, UINumber
- #get-device | where {$_.Name -like '*PCI Express Root Port*' } | select Name,LocationInfo,UINumber
- #get-device | where { $_.AvailableProperties['DEVPKEY_Device_Class'] -eq 'Display' } | % { $_.AvailableProperties['DEVPKEY_Device_BiosDeviceName'] }
- #Get-device | where { $_.Name -like '*PCI Express*' } | % { $_.AvailableProperties }
- #Get-device | where { $_.AvailableProperties['DEVPKEY_Device_InstanceId'] -like 'ACPI\PNP0A08*' } | % { $_.AvailableProperties['DEVPKEY_NAME'] }
- #Get-device | where { $_.AvailableProperties['DEVPKEY_Device_DriverInfSection'] -like '*PCI_ROOT*' } | % { $_.AvailableProperties }
- #Get-device | where { $_.AvailableProperties['DEVPKEY_Device_InstanceId'] -like 'ACPI_HAL\PNP0C08*' } | % { $_.AvailableProperties }
- #Get-device | where { $_.AvailableProperties['DEVPKEY_Device_InstanceId'] -like 'ROOT\ACPI_HAL*' } | % { $_.AvailableProperties }
- write-host 'PCI_ROOT children'
- $pci_roots = Get-device | where { $_.AvailableProperties['DEVPKEY_Device_DriverInfSection'] -like '*PCI_ROOT*' }
- foreach($pci_root in $pci_roots) {
- foreach($child_id in $pci_root.AvailableProperties['DEVPKEY_Device_Children']) {
- $pci_child = get-device | where { $_.AvailableProperties['DEVPKEY_Device_InstanceId'] -eq $child_id -and $_.Service -eq 'pci' }
- if($pci_child.AvailableProperties.Count -gt 0) {
- write-host '>' $pci_child.AvailableProperties['DEVPKEY_Device_BiosDeviceName']
- $like_comp = '{0}.*' -f ($pci_child.AvailableProperties['DEVPKEY_Device_BiosDeviceName'] -replace '\x00','')
- $on_bus = get-device | where { $_.AvailableProperties['DEVPKEY_Device_BiosDeviceName'] -like $like_comp }
- if($on_bus.Count -gt 0) {
- foreach($bus_device in $on_bus) {
- write-host ' ->['$bus_device.AvailableProperties['DEVPKEY_Device_Class']'] [ProblemCode:'$bus_device.AvailableProperties['DEVPKEY_Device_ProblemCode']'] ' $bus_device.Name '@' $bus_device.LocationInfo
- }
- } else { write-host ' <nothing here>' }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment