Last active
January 14, 2018 14:20
-
-
Save Agazoth/cc8e6c5d027f6bee133b82d8ff14b2f9 to your computer and use it in GitHub Desktop.
Iron Scripter 2018 Puzzle 1
This file contains hidden or 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
$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