标题: [转载代码] PowerShell获取显示器尺寸大小(不是分辨率) [打印本页]
作者: HAT 时间: 2022-3-31 00:16 标题: PowerShell获取显示器尺寸大小(不是分辨率)
- 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
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |