I need to capture the status of several network changes to a csv. I have a function that gets the task Id, state, and event chain to log what is changed. For commands like Set-VDPortgroup and Set-NetworkAdapter, I am running them with the -RunAsync flag to capture their task. Unfortunately, there is no -RunAsync flag for Set-VMHostNetworkAdapter, so I cannot capture the task.
Is there an easier way to capture this information than parsing through all of the events for a host to find the right one? Seems messy..