win7 printerdriver removal

I need a script to look at all printers find the ones with printdriver from company “x” and remove the driver and the printer.

for win8 and newer I see remove-printer and remove-printdriver… any ideas for win 7 how I can do this in POSH

thanks as always

You probably could pull this info using WMI or CIM. You could then remove the driver using that info but I don’t know if you can actually uninstall the printer.

I didn’t see a method to remove the driver… any examples?

Take a look at

Get-CimInstance -ClassName Win32_PrinterDriver
, there are some fields that give you a path to the driver files you could delete using

If it’s a 3rd party driver, you can try looking for it with pnputil.

Hello scott s,
Update your powershell version on your windows 7.
You will be able to use Get-PrinterDriver & Remove-PrinterDriver

Those 2 commands are not for win7, just 8 and up.

But thanks to everyone I got it figured out