Public/Get-Printers.ps1

function Get-Printers {

    <#
    .Synopsis
    -Taylor Lee
    Modified 06192019
 
    .DESCRIPTION
    This command returns a list of local or remote printers
 
    .EXAMPLE
    Returns printers for the local computer only.
 
    Get-Printers
 
    .EXAMPLE
    -Computer is used to pull printers from remote computers.
 
    Get-Printers -computer PCName
 
    .EXAMPLE
    Return long list of info on the printers
 
    Get-Printers -computer PCName -complex
    #>


    [CmdletBinding()]

    Param (
        [Parameter(Mandatory = $false)]$computer,
        [Parameter(Mandatory = $false)][switch]$complex
    )

    if ($complex) {
        Get-CimInstance cim_printer -computer $computer | Select-Object Name, Drivername, Portname, Status, SystemName, local, shared, CapabilityDescriptions
    }

    else {
        Get-CimInstance cim_printer -computer $computer | Select-Object Name, Drivername, Portname
    }
}