Welcome back!
Today, I want to provide a small snippet that could list all the monitors installed in you system.
# Get all monitors
$monitors = Get-WmiObject -Namespace root\cimv2 -Class Win32_DesktopMonitor
# Output information about each monitor
foreach ($monitor in $monitors) {
Write-Output "Monitor Name: $($monitor.Name)"
Write-Output "Monitor Manufacturer: $($monitor.Manufacturer)"
Write-Output "Monitor Screen Height: $($monitor.ScreenHeight)"
Write-Output "Monitor Screen Width: $($monitor.ScreenWidth)"
Write-Output "-----------------------------"
}
This was quite quick and easy.
Thanks!
No comments:
Post a Comment