Skip to content

Instantly share code, notes, and snippets.

@sinky
Created May 11, 2015 05:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sinky/4809461a195c69846c3a to your computer and use it in GitHub Desktop.
Save sinky/4809461a195c69846c3a to your computer and use it in GitHub Desktop.
restore XPS Printer with Powershell
$printerclass = [wmiclass]'Win32_Printer';
$printer = $printerclass.CreateInstance();
$printer.Name = $printer.DeviceID = 'Microsoft XPS Document Writer';
$printer.PortName = 'XPSPort:';
$printer.Network = $false;
$printer.Shared = $false;
$printer.DriverName = 'Microsoft XPS Document Writer';
$printer.Put()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment