Support Forums

MSOline module not showing up

Support for all customers who have purchased a SAPIEN PowerShell Studio product license. This forum does not offer a response time guarantee.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE 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.
User avatar
nirmalks
Posts: 30
Joined: Sun Aug 02, 2015 10:01 am

MSOline module not showing up

Postby nirmalks » Sat Feb 06, 2016 4:01 am

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: 30
Joined: Sun Aug 02, 2015 10:01 am

Re: MSOline module not showing up

Postby nirmalks » Sat Feb 06, 2016 6:33 am

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: 30
Joined: Sun Aug 02, 2015 10:01 am

Re: MSOline module not showing up

Postby nirmalks » Sat Feb 06, 2016 6:50 am

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: 4448
Joined: Thu Aug 18, 2011 4:56 am

Re: MSOline module not showing up

Postby davidc » Mon Feb 08, 2016 4:38 pm

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: 30
Joined: Sun Aug 02, 2015 10:01 am

Re: MSOline module not showing up

Postby nirmalks » Wed Feb 10, 2016 12:09 pm

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: 4448
Joined: Thu Aug 18, 2011 4:56 am

Re: MSOline module not showing up

Postby davidc » Wed Feb 10, 2016 12:38 pm

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 1444 times


David
David
SAPIEN Technologies, Inc.

Return to “PowerShell Studio”

Who is online

Users browsing this forum: No registered users and 3 guests

cron