From 090d165eae27ed9cee2c87d3da3a9eb6129baad7 Mon Sep 17 00:00:00 2001 From: sago35 Date: Sat, 4 Jan 2025 14:29:40 +0900 Subject: [PATCH] main: update to use `Get-CimInstance` as `wmic` is being deprecated --- main.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 9f0cc631a9..dee0165582 100644 --- a/main.go +++ b/main.go @@ -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()