There was an interesting question in the PowerCLI Community on how to use the -RunAsync parameter. The user wanted to create a number of new guests and start each guest once the creation was complete. This can be done rather easily by using a New-VM cmdlet and piping the result to the Start-VM cmdlet.
Only problem was, the creation of the new guests was done in Async mode.
That’s where the Get-Task cmdlet and the use of a hash table come in handy.