Copy-MgTeam does not return the header location url to query to see if completed
Copy-MgTeam does not return the header location url to query to see if completed.
Had to instead use Invoke-MgGraphRequest -OutputType HttpResponseMessage to get the Location url.
Hi @techienickb ,
Thanks for identifying and raising this issue. As per the service documentation the only response you are going to get is a http status code 202.
We will however consider returning the header location url in future releases. Meanwhile, you can run the command with a -debug flag in order to get the url.

Glad it'll be looked at in a future release.
From the doc
If successful, this method will return a 202 Accepted response code with a Location: header pointing to the operation resource. When the operation is complete, the operation resource will tell you the id of the created team.
So yes while 202 is the response code a location header is also part of the mandatory return. The debug command doesn't help when it's part of a wider script and the location header is used in the next part of the script and you need direct access to the location header to query if the job is complete before moving onto the next step.
I've used the invoke command to get around this in my script I've written.
Closing as a duplicate of #897.
We are using #897 to track long running operation support (202 response code). The workaround is to use Invoke-MgGraphRequest.