main: update to use Get-CimInstance as wmic is being deprecated

This commit is contained in:
sago35
2025-01-04 14:29:40 +09:00
committed by Ron Evans
parent 0426a5f902
commit 3efc6340ad
+2 -3
View File
@@ -1062,9 +1062,8 @@ func findFATMounts(options *compileopts.Options) ([]mountPoint, error) {
return points, nil
case "windows":
// Obtain a list of all currently mounted volumes.
cmd := executeCommand(options, "wmic",
"PATH", "Win32_LogicalDisk",
"get", "DeviceID,VolumeName,FileSystem,DriveType")
cmd := executeCommand(options, "powershell", "-c",
"Get-CimInstance -ClassName Win32_LogicalDisk | Select-Object DeviceID, DriveType, FileSystem, VolumeName")
var out bytes.Buffer
cmd.Stdout = &out
err := cmd.Run()