We are mainly responsible for general issues of Office desktop applications, but your question seems to be more related to Powershell Script, it is out of our support
I would change the tag to be "not-supported". Thanks for your understanding..
It's recommended to post a new question into the forums below. Maybe you could get some helpful suggestions.
The Official Scripting Guys Forum!
If an 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.