Reputation: 880
Does anyone know a way to find out whether a Print Driver is Package aware or not using Powershell for Windows 2008.
I wasn't able to find that info on Win32_PrinterDriver Class but in Print management when we select Drivers tab it has that info. Any way to get it via Powershell?
Upvotes: 0
Views: 342
Reputation: 6860
Here you go, Get-PrintDriver will bring back all the info for your printers. Select Name, IsPackageAware will display the Name of the printer and Bool for if PackageAware
Get-PrinterDriver | select Name,IsPackageAware
since you said you were working on 2008....I created this.
$Answer = New-Object System.Collections.ArrayList
$Printers = gwmi win32_printerDriver | select Name,DriverPath
foreach($info in (gwmi win32_printerDriver | select Name,DriverPath)){
$Path = $info.DriverPath | select-string -Pattern "(.*?\\)(.*?\\)(.*?\\)(.*?\\)(.*?\\)(.*?\\)" | %{$_.Matches} | %{$_.Value} | Get-ChildItem -Filter *.inf
$answer.Add([PSCustomObject]@{
Name = $info.Name
Path = $Path.FullName
IsPackageAware = $Path | Get-Content | select-string "PackageAware"
})
}
$Answer | select name,IsPackageAware
It reads the INF files and looks for PackageAware keyword
Upvotes: 1