Skip to content

Instantly share code, notes, and snippets.

@Agazoth
Last active January 14, 2018 14:20
Show Gist options
  • Save Agazoth/cc8e6c5d027f6bee133b82d8ff14b2f9 to your computer and use it in GitHub Desktop.
Save Agazoth/cc8e6c5d027f6bee133b82d8ff14b2f9 to your computer and use it in GitHub Desktop.
Iron Scripter 2018 Puzzle 1
$Monitors = Get-CimInstance -Namespace root\wmi -ClassName WmiMonitorID
$Computer = Get-CimInstance -Class Win32_ComputerSystem
$Bios = Get-CimInstance -ClassName Win32_Bios
foreach ($Monitor in $Monitors){
$PSObject = [PSCustomObject]@{
ComputerName = $Computer.Name
ComputerType = $Computer.model
ComputerSerial = $Bios.SerialNumber
MonitorSerial = [string]::join('',$monitor.SerialNumberID.Where{$_ -ne 0})
MonitorType = [string]::join('',$monitor.UserFriendlyName.Where{$_ -ne 0})
}
$PSObject
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment