7 lines
252 B
Python
7 lines
252 B
Python
import subprocess, json
|
|
|
|
cmd = ["powershell", "-NoProfile", "-Command", "Get-Partition | Select-Object DiskNumber, PartitionNumber, DriveLetter, Size, Type | ConvertTo-Json"]
|
|
res = subprocess.run(cmd, capture_output=True, text=True)
|
|
print(res.stdout)
|
|
|