Page 1 of 1

MSOline module not showing up

Posted: Sat Feb 06, 2016 3:01 am
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

Re: MSOline module not showing up

Posted: Sat Feb 06, 2016 5:33 am
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

Re: MSOline module not showing up

Posted: Sat Feb 06, 2016 5:50 am
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!

Re: MSOline module not showing up

Posted: Mon Feb 08, 2016 3:38 pm
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

Re: MSOline module not showing up

Posted: Wed Feb 10, 2016 11:09 am
by nirmalks
The one which causes the problem and always is MSOnlineExtended module. You should never allow PowerShell Studio to insert "Import MSOnlineExtended".

Re: MSOline module not showing up

Posted: Wed Feb 10, 2016 11:38 am
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 3386 times
David