@JurgenVerhelstezNetworking-5458,
As we are mainly responsible for general issue of Microsoft Teams and Skype for Business, your question which is involved in scripts is not supported by us.
You can post a new thread in Teams developer forum where you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction. Thank you for your understanding.
Besides, I find that the last part of the script outputs the test results. You could try to modify the scripts as below:
For more information about the Return keyword, you can refer to this article.
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.