microsoft / MSCloudLoginAssistant

PowerShell Module Handling Authentication to Cloud Services
https://www.powershellgallery.com/packages/MSCloudLoginAssistant/
MIT License
76 stars 52 forks source link

Fixed check for active sessions in Security & Compliance #105

Closed Swampen closed 3 years ago

Swampen commented 3 years ago

The ActiveSessions[0] might have been closed by the loop after. This caused an error while trying to use Import-PSSession on an already closed and disposed session.

To fix this, just check for active sessions after closing the already open connections