PowerShell Persistent Session? IIQ

Which IIQ version are you inquiring about?

8.3p3

Share all details about your problem, including any error messages you may have received.

Hi there, is there a way to have SailPoint call a .ps1 script but launch it within the same PowerShell session that is already opened?

For example; we’re figured out a way to authenticate onto exchange without an interface as seen here on the first script.

image

Is there a way to launch a second script while utilizing the same PowerShell session?

Reason; we’re utilizing SailPoint to customize/isolate a specific population of identities. These should then get passed in (with arguments) to a separate PowerShell script that would do something… IE: converting mailbox to shared, or hiding from Global Address List, etc. If we aren’t able to utilize some sort of persistent PowerShell session, then that means the connection portion would be repeated for each time an identity is iterated through.

I realize this may be more of a PowerShell question than SailPoint but here we are nonethless. Any guidance or tips will be greatly appreciated!

Hi @itzsam91,

did you try this?

String command = "powershell.exe -Command \"& { .\\script1.ps1; .\\script2.ps1 }\"";

Thanks for the reply, have not tried this approach quite yet. I do get an error though with the syntax

1 Like