mbegan / Okta-PSModule

Okta API Powershell Wrapper Module
Other
102 stars 31 forks source link

Update to allow multiple sessions in same PoSh Session #55

Open FFFreak opened 2 years ago

FFFreak commented 2 years ago

This edits _oktaMakeCall to check a state variable based on uri passed to the function to make a unique variable to hold state of websessions. This allows the global:mywebsession variable to be saved at end of function and recalled for EACH org in the Okta_org.ps1. Checking/Saving mywebsession at the start and end of that function allows multiple Okta Orgs to be called within the same Powershell Session.

TODO: There might be invalid characters possible in variable names resulting in unexpected behavior. I did not validate if URL host characters can be the same character space as powershell variable names.