- function get-monitorsize {
- Get-WmiObject -Namespace root\wmi -Class WmiMonitorBasicDisplayParams |
- select @{N="Computer"; E={$_.__SERVER}},
- InstanceName,
- @{N="Horizonal"; E={[System.Math]::Round(($_.MaxHorizontalImageSize/2.54), 2)}},
- @{N="Vertical"; E={[System.Math]::Round(($_.MaxVerticalImageSize/2.54), 2)}},
- @{N="Size";
- E={[System.Math]::Round(([System.Math]::Sqrt([System.Math]::Pow($_.MaxHorizontalImageSize, 2) `
- + [System.Math]::Pow($_.MaxVerticalImageSize, 2))/2.54),2)}}
- }
- get-monitorsize
复制代码 转自:
https://social.technet.microsoft.com/Forums/scriptcenter/en-US/620cacb9-25d8-4610-b30b-378ba4c6218c/get-monitor-size |