I have a program that is used for creating O365 Content Searches using the ExchangeOnlineManagement module. Trying to get this to work for MFA.
When the operation is ran from the program it calls a ps1 file and run the Connect-IPPSSession command it fails saying the module is not loaded. This is true for any command from this module and I cannot load this module in this script either.
When I run PS as an admin and use the Get-InstalledModule PS command to get the modules installed I get:
1.0.1 ExchangeOnlineManagement PSGallery This is a General Availability (GA) release of Exchange Online PowerShell V2 module....
When I run PS as any other user and run the Get-InstalledModule command I get the same thing. So I know that I have this module loaded and installed successfully for all users.
If I use the PS ISE and run the script I am calling from my program from any user it runs just fine.
Now, here is the kicker, if I leave the PS session window open from when the program operation opens it and try the Get-InstalledModule command it cannot find the module. Nor can I install, or import the module by name, path, even trying the loading the Microsoft.Exchange.Management.ExoPowershellModule.dll. Nothing allows this module to load from this PS session
modified I think that I can ask this problem another way and get better answers. Since I am in fact running PowerShell from a Shell session this may change things on how Powershell works, though I don't know how.
So how do you install or call Powershell modules that are available from Powershell running in a shell session or Any ideas on how to load this module to work.
Thanks
$env:PSModulePath
match in both sessions? Where is the actual module located? You can find this withGet-Module ExchangeOnlineManagement | Select-Object Path
– CrookedJ