MSOline module not showing up

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 8 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
nirmalks
Posts: 38
Last visit: Tue Mar 26, 2024 5:02 am

MSOline module not showing up

Post by nirmalks »

Product, version and build: 2015
32 or 64 bit version of product: 32
Operating system: Win7
32 or 64 bit OS: 32

Even after clicking "Build modules" or refresh icon, Powershell Studio is not showing up MSOnline module.

Can I copy MSOnline module (PSD file) and then import in script?

Thanks,
Nirmal
User avatar
nirmalks
Posts: 38
Last visit: Tue Mar 26, 2024 5:02 am

Re: MSOline module not showing up

Post by nirmalks »

Ok. I can see MSOnline and MSOnlineExtended module, but I see below behavior:

-If I run MSOnline cmdlet from PowerShell Studio "Console" - it works
-If I write below code in script and then click on Home > Run, it doesn't work!
$Cred = Get-Credential
Connect-MSOnlineService -Credential $Creds

Output window shows nothing for "Connect-MSOnlineService" cmdlet, but for Get-MSOlSubscription as listed below:

ERROR: Get-MsolSubscription : Could not load file or assembly 'Microsoft.Online.Administration.Automation.PSModule.Resources, Version=1.0.0.0, Culture=neutral,
ERROR: PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.At C:\file path
ERROR: + $OSubNow = Get-MsolSubscription
ERROR: + ~~~~~~~~~~~~~~~~~~~~
ERROR: + CategoryInfo : OperationStopped: (:) [Get-MsolSubscription], FileNotFoundException
ERROR: + FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.Online.Administration.Automation.GetSubscription
ERROR:

I can assume it is something to do with module file, but not quite sure.

Since PowerShell Studio 2015 was not showing up MSOnline module, I checked PSModulePath and rather than modifying the path to C:\Windows\System32\PowerShell\MSOnline folder where MSOnline module resides, I copied MSOnline and MSOnlineExtended folders to one of the locations found in PSModulePath.

Help is much appreciated.

Thanks
Nirmal
User avatar
nirmalks
Posts: 38
Last visit: Tue Mar 26, 2024 5:02 am

Re: MSOline module not showing up

Post by nirmalks »

I just checked using the script found here: download/file.php?id=619

I'm able to connect, but If I use the same code in my script, it doesn't work!
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: MSOline module not showing up

Post by davidc »

My initial guess would be to check the platform you are running (64 Bit vs 32 Bit / PowerShell version) because the System32 folder location is tied to the platform. For example, in a 32 bit process the System32 folder is mapped to C:\Windows\SysWOW64 folder instead (In a 64 bit OS).

David
David
SAPIEN Technologies, Inc.
User avatar
nirmalks
Posts: 38
Last visit: Tue Mar 26, 2024 5:02 am

Re: MSOline module not showing up

Post by nirmalks »

The one which causes the problem and always is MSOnlineExtended module. You should never allow PowerShell Studio to insert "Import MSOnlineExtended".
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: MSOline module not showing up

Post by davidc »

Note: You can disable the auto insertion of import commands in Options->Editor:
Auto-insert import commands.png
Auto-insert import commands.png (43.27 KiB) Viewed 3383 times
David
David
SAPIEN Technologies, Inc.
This topic is 8 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.