I am working on an application that calls the Connect-MicrosoftTeams module for Powershell 5.1. However, when I launch the application, it just hangs. I have tried the following versions of Connect-MicrosoftTeams and I have ensured that each module showed in both the Object Viewer and the Cache and nothing has worked.
3.0.0
2.6.0
2.5.1
2.2.0-preview
I am using PowerShell Studio 2019, version 5.6.160. Any guidance/assistance would be super appreciated.
Regards,
Roger
Connect-MicrosoftTeams not creating the login window
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
- code20runner
- Posts: 20
- Last visit: Thu Jul 28, 2022 11:52 am
Re: Connect-MicrosoftTeams not creating the login window
How are you trying to connect? By the console? From a script? From a psf file?
If you are trying to connect from the console, it important that I say that PowerShell Studio's embedded consoles do not function the same as in the ISE. Rather than being connected, the console and the editor run under different runspaces. For the editor specifically, it runs under a new runspace on every run. This was done intentionally to prevent runspace corruption. Nothing that is imported in the embedded console from the Console panel will affect a script when running (Ctrl+F5) or debugging (F5) unless you are always running the script in the console (Ctrl+F8).
Microsoft 365 module connections generally hang in GUI environments. For more helpful information, please look at the following post: viewtopic.php?t=15297
If you are trying to connect from the console, it important that I say that PowerShell Studio's embedded consoles do not function the same as in the ISE. Rather than being connected, the console and the editor run under different runspaces. For the editor specifically, it runs under a new runspace on every run. This was done intentionally to prevent runspace corruption. Nothing that is imported in the embedded console from the Console panel will affect a script when running (Ctrl+F5) or debugging (F5) unless you are always running the script in the console (Ctrl+F8).
Microsoft 365 module connections generally hang in GUI environments. For more helpful information, please look at the following post: viewtopic.php?t=15297
Brittney
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- code20runner
- Posts: 20
- Last visit: Thu Jul 28, 2022 11:52 am
Re: Connect-MicrosoftTeams not creating the login window
Brittney,
I am running the application from within PowerShell Studio, so I would expect it to function just like any other app and not run in the PowerShell Studio console.
I have followed the information in the linked thread but that doesn't seem to resolve the issue. Do I need to upgrade to the latest version of PowerShell Studio to get it to work?
Roger
I am running the application from within PowerShell Studio, so I would expect it to function just like any other app and not run in the PowerShell Studio console.
I have followed the information in the linked thread but that doesn't seem to resolve the issue. Do I need to upgrade to the latest version of PowerShell Studio to get it to work?
Roger
- code20runner
- Posts: 20
- Last visit: Thu Jul 28, 2022 11:52 am
Re: Connect-MicrosoftTeams not creating the login window
Anyone with any ideas on how to overcome this problem? Is it a software version issue?
Re: Connect-MicrosoftTeams not creating the login window
Are you running a script or form? Can you please provide a screenshot of what you are seeing?
Brittney
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- code20runner
- Posts: 20
- Last visit: Thu Jul 28, 2022 11:52 am
Re: Connect-MicrosoftTeams not creating the login window
Brittney,
I am running the code from a form. When I run the Connect-MicrosoftTeams from within the Powershell ISE, I get the Office365 log-in credentials window. When I press the green "RUN" triangle and try to run the same command from my form, the application locks up and I have to use "Task Manager" to end the task.
I have attached a picture of the code.
Thanks,
Roger
I am running the code from a form. When I run the Connect-MicrosoftTeams from within the Powershell ISE, I get the Office365 log-in credentials window. When I press the green "RUN" triangle and try to run the same command from my form, the application locks up and I have to use "Task Manager" to end the task.
I have attached a picture of the code.
Thanks,
Roger
- Attachments
-
- Connect-MicrosoftTeams Info.PNG (144.51 KiB) Viewed 10929 times
Re: Connect-MicrosoftTeams not creating the login window
Please trying moving the Connect-MicrosoftTeams command to the Startup.pss file so the connection can be created before the form is initialized.
Brittney
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.