mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-02 10:59:14 +01:00
Update list-printers.ps1
This commit is contained in:
parent
6df3796258
commit
37a7468559
@ -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])"
|
||||
|
Loading…
Reference in New Issue
Block a user