Created
January 16, 2018 21:40
-
-
Save wpietrzakpl/3d2405637afc242be5cbff7d2909f9fd to your computer and use it in GitHub Desktop.
Battle Faction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Monitor = Get-WmiObject -Class wmiMonitorID -Namespace root\wmi | |
$Computer = Get-WmiObject -Class Win32_ComputerSystem -Namespace root\cimv2 | |
foreach ($m in $Monitor) { | |
$PSObject = [PSCustomObject]@{ | |
ComputerName = $env:COMPUTERNAME | |
ComputerType = $Computer.Model | |
ComputerSerial = $Computer.Name | |
MonitorSerial = ($Monitor.SerialNumberID -ne 0) -join "" | |
MonitorType = ($Monitor.UserFriendlyName -ne 0) -join "" | |
} | |
$PSObject | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment