Is there a way to store powershell remote sessions, in my case sessions to exchange online and security compliance center, and use the same session between APIs and Scripts?
I want to keep sessions open so that it’s faster running commands and don’t have to wait for the remote session to stay up.
This isn’t possible as far as I know. You can use -PersistentRunspace on New-PSUEnvironment to create an environment that won’t reset the runspaces through executions so it will be faster for the API but this won’t affect jobs.