Use same powershell module with different instances in same script

61 Views Asked by At

So, I have a PowerShell module that I want to use called psPAS. Its a wrapper containing APIs for CyberArk software where we use New-PASsession (and pass the URL) to authenticate to CyberArk application.

My query is a generic one - how I can use the same PowerShell module for 2 different instances/URLs for cyberark. For example during migration I want to export data using the older env(URL1) and import it at the same time to new env(URL2) using this module.

Can we make a object for something for something like this in PowerShell. For ex: if I use P1.New-PASSession(and pass URL1) then I can use P1.AnyOtherWrapper to use with Older env URL and use P2.New-PASSession(and pass URL2) then I can use P2.AnyOtherWrapper to use with New env URL??

I want to use both together at the same runtime.

0

There are 0 best solutions below