Power shell 读取电量,改变屏幕亮度
1. Get-Wmiobject -List win32* # 列出所有win32_信息(基本的BIOS,Battery , Memory, processor)
2.Get-WmiObject -class Win32_BIOS # 罗列出BIOS的相关信息
3.查找出battery的电量:
$a=Get-WmiObject -class Win32_Battery
$a.EstimatedChargeRemaining
4.改变屏幕亮度:
$B = Get-WmiObject -Namespace root/WMI -Class WmiMonitorBrightnessMethods
$B.WmiSetBrightness(1, $X) #X是你想要的亮度
5.get-member -inputobject $B 获取$B所有的子属性
6.CMD 下输入Powershell -Command "& {指令}"则可以运行Powershell命令