我的要求是用python运行PowerShell
脚本。
但这是错误的
我的Python脚本:
import subprocess, sys
p = subprocess.Popen(["powershell.exe",
"D:\\Python\\EXPORT_AD_GROUP.ps1"],
stdout=sys.stdout)
p.communicate()
错误:
Traceback (most recent call last):
File "D:/Python/Power_Shell_Python.py", line 3, in <module>
p = subprocess.Popen(["powershell.exe",
File "C:\Users\htembkar\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 804, in __init__
errread, errwrite) = self._get_handles(stdin, stdout, stderr)
File "C:\Users\htembkar\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 1174, in _get_handles
c2pwrite = msvcrt.get_osfhandle(stdout.fileno())
io.UnsupportedOperation: fileno
目前没有回答
相关问题 更多 >
编程相关推荐