Python 3.x powershell脚本未从pyinstaller exe运行

Python 3.x powershell脚本未从pyinstaller exe运行,python-3.x,windows,powershell,pyinstaller,Python 3.x,Windows,Powershell,Pyinstaller,该函数作为python脚本在VS代码中运行良好。但是,当我从脚本使用pyinstaller生成exe时,不会调用powershell。我错过了什么?脚本中的其他函数(python)与exe中的相同 def run_backups(): p = subprocess.Popen(["powershell.exe",r"D:\_POWER_SHELL\Scripts\backup.ps1"],stdout=sys.stdout) p.co

该函数作为python脚本在VS代码中运行良好。但是,当我从脚本使用pyinstaller生成exe时,不会调用powershell。我错过了什么?脚本中的其他函数(python)与exe中的相同

def run_backups():
    p = subprocess.Popen(["powershell.exe",r"D:\_POWER_SHELL\Scripts\backup.ps1"],stdout=sys.stdout)   
    p.communicate()