I need to create a component in a larger pipeline that starts vpn service and waits for a connection to be established before proceeding. I'd like to do this with Powershell if possible. I imagine the logic flow being something like this, but the multithreading aspect is vexing me.
create an event log handler
start a service
wait for a specific event log entry
exit