Skip to content

Commit 0a0437c

Browse files
sago35deadprogram
authored andcommitted
main: update to use Get-CimInstance as wmic is being deprecated
1 parent 7190e01 commit 0a0437c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

main.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,9 +1062,8 @@ func findFATMounts(options *compileopts.Options) ([]mountPoint, error) {
10621062
return points, nil
10631063
case "windows":
10641064
// Obtain a list of all currently mounted volumes.
1065-
cmd := executeCommand(options, "wmic",
1066-
"PATH", "Win32_LogicalDisk",
1067-
"get", "DeviceID,VolumeName,FileSystem,DriveType")
1065+
cmd := executeCommand(options, "powershell", "-c",
1066+
"Get-CimInstance -ClassName Win32_LogicalDisk | Select-Object DeviceID, DriveType, FileSystem, VolumeName")
10681067
var out bytes.Buffer
10691068
cmd.Stdout = &out
10701069
err := cmd.Run()

0 commit comments

Comments
 (0)