Update list-printers.ps1

This commit is contained in:
Markus Fleschutz 2022-12-04 10:46:19 +01:00
parent 6df3796258
commit 37a7468559

View File

@ -1,6 +1,6 @@
<#
.SYNOPSIS
Lists all printers known to the local computer
Lists the printers
.DESCRIPTION
This PowerShell script lists all printers known to the local computer.
.EXAMPLE
@ -12,8 +12,12 @@
#>
try {
$ComputerName = $(hostname)
get-WMIObject -Class Win32_Printer -ComputerName $ComputerName | format-table
if ($IsLinux) {
# TODO
} else {
$ComputerName = $(hostname)
Get-WMIObject -Class Win32_Printer -ComputerName $ComputerName | Format-Table
}
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"