你可以使用 Python 的 subprocess 模块来调用 PowerShell。例如:
import subprocess
powerShellCommand ="Write-Host 'Hello from PowerShell'"
# Run the PowerShell command using subprocess.run
result = subprocess.run(["powershell", "-Command", powerShellCommand], capture_output=True, text=True)
# print the outpu