Skip to content

Instantly share code, notes, and snippets.

@wpietrzakpl
Created January 16, 2018 21:40
Show Gist options
  • Save wpietrzakpl/3d2405637afc242be5cbff7d2909f9fd to your computer and use it in GitHub Desktop.
Save wpietrzakpl/3d2405637afc242be5cbff7d2909f9fd to your computer and use it in GitHub Desktop.
Battle Faction
$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