标题: [原创代码] PowerShell判断电脑是台式机还是笔记本 [打印本页]
作者: DAIC 时间: 2013-9-2 20:51 标题: PowerShell判断电脑是台式机还是笔记本
在别的论坛看到有人问这个问题,我试着写了一下。- $objSysEnc = gwmi Win32_SystemEnclosure
- switch ($objSysEnc.ChassisTypes) {
- 1 {"Other"; break}
- 2 {"Unknown"; break}
- 3 {"Desktop"; break}
- 4 {"Low Profile Desktop"; break}
- 5 {"Pizza Box"; break}
- 6 {"Mini Tower"; break}
- 7 {"Tower"; break}
- 8 {"Portable"; break}
- 9 {"Laptop"; break}
- 10 {"Notebook"; break}
- 11 {"Hand Held"; break}
- 12 {"Docking Station"; break}
- 13 {"All in One"; break}
- 14 {"Sub Notebook"; break}
- 15 {"Space-Saving"; break}
- 16 {"Lunch Box"; break}
- 17 {"Main System Chassis"; break}
- 18 {"Expansion Chassis"; break}
- 19 {"SubChassis"; break}
- 20 {"Bus Expansion Chassis"; break}
- 21 {"Peripheral Chassis"; break}
- 22 {"Storage Chassis"; break}
- 23 {"Rack Mount Chassis"; break}
- 24 {"Sealed-Case PC"; break}
- default {"unknown"}
- }
复制代码
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |