This is my first attempt at EventGhost, so please bear with me.
As part of an Unlock Workstation Macro, I have a Session.Unlock Event then a Python Script Action.
In the Python Script action, I have a Powershell script which turns on and off my Windows 10 bluetooth adapter based on time of day.
There is an error thrown, not in the EG log, but a command window pops up really fast then closes, so I can't read it.
1) Is this the right way to invoke my PS script?
2) How can I capture the error that is thrown?
I can successfully run the Powershell on the command line.
Thanks for any help.
Code: Select all
import datetime import time import subprocess import sys timestamp = datetime.datetime.now().time() # Throw away the date information time.sleep(1) start = datetime.time(7, 55) end = datetime.time(12) subprocess.Popen(["powershell.exe", "C:\\Users\\humble\\bluetooth.ps1 -BluetoothStatus Off"])