Skip to content

Commit

Permalink
main: update to use Get-CimInstance as wmic is being deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
sago35 authored and deadprogram committed Jan 4, 2025
1 parent 0426a5f commit 3efc634
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 3efc634

Please sign in to comment.