mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-01-07 06:28:55 +01:00
Update list-print-jobs.ps1
This commit is contained in:
parent
37a7468559
commit
e23add455f
@ -1,6 +1,6 @@
|
|||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Lists all jobs of all printers
|
Lists all print jobs
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
This PowerShell script lists all print jobs of all printer devices.
|
This PowerShell script lists all print jobs of all printer devices.
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
@ -14,6 +14,9 @@
|
|||||||
#Requires -Version 4
|
#Requires -Version 4
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if ($IsLinux) {
|
||||||
|
# TODO
|
||||||
|
} else {
|
||||||
$printers = Get-Printer
|
$printers = Get-Printer
|
||||||
if ($printers.Count -eq 0) { throw "No printer found" }
|
if ($printers.Count -eq 0) { throw "No printer found" }
|
||||||
|
|
||||||
@ -28,6 +31,7 @@ try {
|
|||||||
"$($printer.Name) $printjobs"
|
"$($printer.Name) $printjobs"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
Loading…
Reference in New Issue
Block a user