PowerTip of the Day, from PowerShell.com:
Finding More Driver Information
In a previous tip you learned how you can convert raw CSV data from a console application such as driverquery.exe into real PS objects. Let's play some more.
Since the CSV data only returns the complete path to a driver (which is too long to display without being truncated), let's add a "calculated property". That's a hash table with two keys: Name and Expression.
The script block in Expression takes the long path name and extracts just the file name. Now we get valuable driver information that - due to its object nature - can easily be sorted as well:
PS> $col1 = @{Name='File Name'; Expression={ Split-Path $_.Path -Leaf } }
PS> driverquery.exe /v /FO CSV | ConvertFrom-CSV | Select-Object 'Display Name',
'Start Mode', 'Paged Pool(bytes)', $col1 | Sort-Object 'Display Name'
Display Name Start Mode Paged Pool(bytes) File Name
------------ ---------- ----------------- ---------
ACPI-Energieanze... Manual
adp94xx
adpahci
adpu320
Agere Systems So... Manual
aliide
AMD K8 Processor... Manual
AMD Processor Dr... Manual 28.672
amdide Manual
amdsata
(...)
Thanks
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.