Hi @Alex_Ma ,
As your issue is related to Teams, please add the Teams tag for better support.
Hope this link could be helpful.
https://childebrandt42.wordpress.com/2020/07/14/using-powershell-to-automate-file-adds-to-teams-and-sharepoint-online/
Tip: This answer contains the content of a third-party website. Microsoft makes no representations about the content of these websites. We provide this content only for your convenience.
Best Regards,
Ian Xue
============================================
If the Answer 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.