TomBarbour
Contributor
Contributor

Capture task of Set-VMhostNetworkAdapter

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.. 

0 Kudos
1 Reply
LucD
Leadership
Leadership

I'm afraid not.

You can fine-tune (filter) the collection of the events by using the event collector via the API.
Like I did in my Get-VIEventPlus function in Get the vMotion/svMotion history


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos