Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Initiate Exchange Remoting session within a PowerShell Module

$
0
0

As an Office 365 shop, I'm working on a PowerShell module to encapsulate lower-level functionality within task-based functions (e.g., relicensing a user and setting litigation hold, configuring resource mailboxes, etc.).  As part of the module, I would like to be able to have a function to connect to Exchange Online and allow the imported session to persist in the interactive session.  Right now, I have a function that calls the appropriate New-PSSession and Import-PSSession cmdlets, but it doesn't work if I call the function from within the imported module.  If I call the statements interactively (in ISE, highlight the interior of the function and Run Selection), the code works as expected.

Am I missing the a PassThru parameter to allow this to function?  Does anyone have other ideas on how I might structure this?

Thanks!


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>