This commit is contained in:
Markus Fleschutz 2022-12-04 11:16:10 +01:00
commit aef9527491
2 changed files with 23 additions and 15 deletions

View File

@ -1,6 +1,6 @@
<#
.SYNOPSIS
Lists all jobs of all printers
Lists all print jobs
.DESCRIPTION
This PowerShell script lists all print jobs of all printer devices.
.EXAMPLE
@ -14,6 +14,9 @@
#Requires -Version 4
try {
if ($IsLinux) {
# TODO
} else {
$printers = Get-Printer
if ($printers.Count -eq 0) { throw "No printer found" }
@ -28,6 +31,7 @@ try {
"$($printer.Name) $printjobs"
}
}
}
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

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 {
if ($IsLinux) {
# TODO
} else {
$ComputerName = $(hostname)
get-WMIObject -Class Win32_Printer -ComputerName $ComputerName | format-table
Get-WMIObject -Class Win32_Printer -ComputerName $ComputerName | Format-Table
}
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"