Skip to content

Instantly share code, notes, and snippets.

@josephkern
Created July 20, 2017 15:53
Show Gist options
  • Save josephkern/18ca113edb10450add90bca40b9ebec5 to your computer and use it in GitHub Desktop.
Save josephkern/18ca113edb10450add90bca40b9ebec5 to your computer and use it in GitHub Desktop.

Revisions

  1. josephkern created this gist Jul 20, 2017.
    5 changes: 5 additions & 0 deletions Get-PrintersAndPorts.ps1
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    function GetPrintersAndPorts {
    foreach ($printer in $(Get-Printer)) {
    Get-PrinterPort -Name $printer.PortName | select @{name='Printer';expression={$printer.Name}}, PrinterHostAddress
    }
    }