mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-13 00:09:50 +01:00
Update list-printers.ps1
This commit is contained in:
parent
6df3796258
commit
37a7468559
@ -1,6 +1,6 @@
|
|||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Lists all printers known to the local computer
|
Lists the printers
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
This PowerShell script lists all printers known to the local computer.
|
This PowerShell script lists all printers known to the local computer.
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
@ -12,8 +12,12 @@
|
|||||||
#>
|
#>
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if ($IsLinux) {
|
||||||
|
# TODO
|
||||||
|
} else {
|
||||||
$ComputerName = $(hostname)
|
$ComputerName = $(hostname)
|
||||||
get-WMIObject -Class Win32_Printer -ComputerName $ComputerName | format-table
|
Get-WMIObject -Class Win32_Printer -ComputerName $ComputerName | Format-Table
|
||||||
|
}
|
||||||
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