Commit 4300faf8 by 陶腾飞

2022-04-22

parent dfb647c1
......@@ -41,3 +41,5 @@ Get-PhysicalDisk
2022年3月26日:增加内存的DDR信息
2022年3月27日:加快CPU获取信息的速度
2022年4月2日:跳过MSVD,增加对DDR4的判断
\ No newline at end of file
......@@ -149,6 +149,12 @@ func getHardwareMemoryForPS() ([]int, []string, []string, int) {
m = "DDR3"
case "26":
m = "DDR4"
case "0":
if i, err := strconv.Atoi(Speed[j]); err != nil {
m = ""
} else if i >= 2133 {
m = "DDR4"
}
default:
m = ""
}
......@@ -166,7 +172,6 @@ func getHardwareMemoryForPS() ([]int, []string, []string, int) {
}
return Capacity, Speed, MemoryType, j - 1
}
func getHardwareHardDiskForPS(mini bool) ([]string, []int64, []string, int) {
MediaType := make([]string, 2)
FriendlyName := make([]string, 2)
......@@ -184,6 +189,10 @@ func getHardwareHardDiskForPS(mini bool) ([]string, []int64, []string, int) {
m = "固态硬盘"
case "HDD":
m = "机械硬盘"
// 跳过U盘
case "Unspecified":
// 2+1后开始重置
c = 2
}
}
......@@ -203,6 +212,10 @@ func getHardwareHardDiskForPS(mini bool) ([]string, []int64, []string, int) {
FriendlyName[j] = m
}
// 跳过虚拟硬盘
if FriendlyName[j] == "Msft Virtual Disk" {
c = 2
}
c++
} else if strings.Index(line, "Size") != -1 {
Size := strings.TrimSpace(strings.Split(line, ":")[1])
......@@ -223,9 +236,7 @@ func getHardwareHardDiskForPS(mini bool) ([]string, []int64, []string, int) {
}
}
// for i := 0; i <= j; i++ {
// fmt.Printf("%s %dGB %s\n", FriendlyName[i], Sizen[i], MediaType[i])
// }
return FriendlyName, Sizen, MediaType, j - 1
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment