As we are mainly responsible for general issue of Microsoft Teams, your question which is involved in development is not supported by us. I would remove the office-teams-windows-itpro tag.
Meanwhile, I found a script which provide the ability to create a Microsoft Team using Microsoft Teams PowerShell Module. You must install the latest version of the module from PowerShell Gallery. The script uses a CSV File as input. For more information, please refer to this link: https://gallery.technet.microsoft.com/scriptcenter/Create-using-CSV-d8294bc9.
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.