在别的论坛看到有人问这个问题,我试着写了一下。- $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"}
- }
复制代码
|