I'm trying to work with Powershell in python and work with get-disk command I tried to work with stdout and print it but the value of it is gone right after I use the Communicate() function Here's my code:
proc = subprocess.Popen(r"C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe", stdin = subprocess.PIPE,
stdout = subprocess.PIPE)
stdout, stderr = proc.communicate('get-disk')
print stdout
Any suggestions?