function Convert-BigEndianToLittleEndian {
param(
[int]$BigEndianValue
)
$bytes = [System.BitConverter]::GetBytes($BigEndianValue)
[Array]::Reverse($bytes)
return [System.BitConverter]::ToUInt32($bytes,0)
}
foreach ($Monitor in @(Get-WmiObject -Namespace root\wmi -Class WmiMonitorID)) {
$bigEndianInt32 = [Convert]::ToInt32(-join $Monitor.ManufacturerName[0..2].ForEach({[Convert]::ToString($_ - 64,2).PadLeft(5,'0')}),2)
$Manufacturer = (Convert-BigEndianToLittleEndian $bigEndianInt32) -shr 16
$ProductID = [int]::Parse(-join $Monitor.ProductCodeID[0..3].ForEach{[char]$_}, [System.Globalization.NumberStyles]::HexNumber)
$Model = ([System.Text.Encoding]::ASCII.GetString($Monitor.UserFriendlyName[0..($Monitor.UserFriendlyNameLength -3)]) -split ' ')[0]
'EDID_{0}_{1}_{2}_12' -f $Manufacturer, $ProductID, $Model #DisplayPath
$Display0 = 'EDID_{0}_{1}_{2}_0' -f $Manufacturer, $ProductID, $Model #DisplayPath
$Display1 = 'EDID_{0}_{1}_{2}_1' -f $Manufacturer, $ProductID, $Model #DisplayPath
$Display2 = 'EDID_{0}_{1}_{2}_2' -f $Manufacturer, $ProductID, $Model #DisplayPath
$Display3 = 'EDID_{0}_{1}_{2}_3' -f $Manufacturer, $ProductID, $Model #DisplayPath
$Display4 = 'EDID_{0}_{1}_{2}_4' -f $Manufacturer, $ProductID, $Model #DisplayPath
$Display5 = 'EDID_{0}_{1}_{2}_5' -f $Manufacturer, $ProductID, $Model #DisplayPath
$Display6 = 'EDID_{0}_{1}_{2}_6' -f $Manufacturer, $ProductID, $Model #DisplayPath
$Display7 = 'EDID_{0}_{1}_{2}_7' -f $Manufacturer, $ProductID, $Model #DisplayPath
$Display8 = 'EDID_{0}_{1}_{2}_8' -f $Manufacturer, $ProductID, $Model #DisplayPath
$Display9 = 'EDID_{0}_{1}_{2}_9' -f $Manufacturer, $ProductID, $Model #DisplayPath
$Display10 = 'EDID_{0}_{1}_{2}_10' -f $Manufacturer, $ProductID, $Model #DisplayPath
$Display11 = 'EDID_{0}_{1}_{2}_11' -f $Manufacturer, $ProductID, $Model #DisplayPath
$Display12 = 'EDID_{0}_{1}_{2}_12' -f $Manufacturer, $ProductID, $Model #DisplayPath
$Display13 = 'EDID_{0}_{1}_{2}_13' -f $Manufacturer, $ProductID, $Model #DisplayPath
}
foreach ($HWID in @(Get-CimInstance win32_VideoController | Where-Object {$_.AdapterDACType -notlike "Internal"} | Select-Object -ExpandProperty PNPDeviceID)) {
$ClassGUID = Get-ItemPropertyValue -Path "HKLM:SYSTEM\ControlSet001\Enum\$HWID" -Name ClassGUID
$ClassGUID
#New-Item -Path "HKLM:SYSTEM\ControlSet001\Control\Class\$ClassGUID\0000\DAL3_DATA\common\$Display12" -Force
#New-ItemProperty -Path "HKLM:SYSTEM\ControlSet001\Control\Class\$ClassGUID\0000\DAL3_DATA\common\$Display12" -Name "color_depth" -Value ([byte[]]@(0x02,0x00,0x00,0x00)) -PropertyType Binary -Force
Set-ItemProperty -Path "HKLM:SYSTEM\ControlSet001\Control\Class\$ClassGUID\0000\DAL3_DATA\common\$Display12" -Name "color_depth" -Value ([byte[]]@(0x02,0x00,0x00,0x00)) -Force
#New-Item -Path "HKLM:SYSTEM\ControlSet001\Control\Class\$ClassGUID\0001\DAL3_DATA\common\$Display12" -Force
#New-ItemProperty -Path "HKLM:SYSTEM\ControlSet001\Control\Class\$ClassGUID\0001\DAL3_DATA\common\$Display12" -Name "color_depth" -Value ([byte[]]@(0x02,0x00,0x00,0x00)) -PropertyType Binary -Force
Set-ItemProperty -Path "HKLM:SYSTEM\ControlSet001\Control\Class\$ClassGUID\0001\DAL3_DATA\common\$Display12" -Name "color_depth" -Value ([byte[]]@(0x02,0x00,0x00,0x00)) -Force
#New-Item -Path "HKLM:SYSTEM\CurrentControlSet\Control\Class\$ClassGUID\0000\DAL3_DATA\common\$Display12" -Force
#New-ItemProperty -Path "HKLM:SYSTEM\CurrentControlSet\Control\Class\$ClassGUID\0000\DAL3_DATA\common\$Display12" -Name "color_depth" -Value ([byte[]]@(0x02,0x00,0x00,0x00)) -PropertyType Binary -Force
Set-ItemProperty -Path "HKLM:SYSTEM\CurrentControlSet\Control\Class\$ClassGUID\0000\DAL3_DATA\common\$Display12" -Name "color_depth" -Value ([byte[]]@(0x02,0x00,0x00,0x00)) -Force
#New-Item -Path "HKLM:SYSTEM\CurrentControlSet\Control\Class\$ClassGUID\0001\DAL3_DATA\common\$Display12" -Force
#New-ItemProperty -Path "HKLM:SYSTEM\CurrentControlSet\Control\Class\$ClassGUID\0001\DAL3_DATA\common\$Display12" -Name "color_depth" -Value ([byte[]]@(0x02,0x00,0x00,0x00)) -PropertyType Binary -Force
Set-ItemProperty -Path "HKLM:SYSTEM\CurrentControlSet\Control\Class\$ClassGUID\0001\DAL3_DATA\common\$Display12" -Name "color_depth" -Value ([byte[]]@(0x02,0x00,0x00,0x00)) -Force
}
cmd /k 'pause'