PowerShell Sessions & Module Compatibility with User Management

Product: PowerShell Universal
Version: 1.4.6

Hello, I am looking for a software solution to act as a user interface for a User Management module I have created. As it works currently, a technician will open a script that acts as a main menu in a terminal user interface and the user can select from the various scripts I have created. Most of these scripts connect to Microsoft modules (MSOnline, AzAD, Graph API, PnP.PowerShell, and a few others).

The nice thing about using the terminal is that I have created functions to check if a user is already signed into the module with their Microsoft account, which prevents users from repeatedly signing in each time the script is run. I went to test this in the free version of PowerShell universal but it appears this is a paid feature.

My question is, if I replaced my Main Menu script with a Dashboard, would the dashboard be able to keep my current PS Session with all the connected modules to prevent having the users sign in each time they create a new user, separate a user, etc.?

It depends a bit on how you login to those modules. If there is some way to store a session or something in a local variable, and then reapply it during other activities, then you will be able to do it.

If the connection relies on some internal runspace state, then it won’t necessarily work because we reset runspace state per action.

That said, maybe others have experience with these modules and could chime in.