Show progress for async operations
Would you please consider making sure that anywhere that the Graph module bundle invokes an async operation that you return PowerShell progress records by invoking Write-Progress as you poll for the status of that operation? Would you also please consider making sure that you have an option to invoke an async operation asynchronously, with a command that can be used to check the status?
The use cases are simple:
-
If I am invoking a longer-running task, such as provisioning a team using a template (which doesn't work directly right now via a built-in function from the Graph module bundle but can be made to work using Get-MgContext and then calling appropriate APIs directly), I may want my script to wait until that task completes, but since it is an asynchronous task that requires multiple calls to Graph to check the status of that task before it can be reported as complete, I want ProgressRecord instances to be output via Write-Progress so that I can leverage that information in tooling that I build around my script and see the latest progress information about that script.
-
Similarly, I may be invoking multiple longer running scripts, where I want to do a bunch of things in parallel, and since Graph includes some APIs that support async invocation, I want to be able to invoke those cmdlets, know that the requests were accepted (meaning that the information provided passed any checks done by the API), and then be able to poll Graph myself for multiple asynchronous tasks that are running so that I can track their progress and report on it in tooling that I build around my script.
In both of these cases, I can do this myself using Graph APIs directly, but then I lose the simplicity of working with PowerShell commands, so I wanted to raise the need for PowerShell to support these two scenarios for asynchronous commands so that async tasks can be run and blocked on or run and tracked asynchronously along with other running tasks.
Thank you. AB#7413