I'm trying to find out using C# if MSOnline PowerShell module is available at OS.
From the first look - nothing difficult. We can invoke PowerShell methods from C#. But for some reason all code snippets I tried to use do not get result with MSOnline module.
For example we use method http://www.codeproject.com/Articles/18229/How-to-run-PowerShell-scripts-from-C and pass command like:
Get-Module -ListAvailable -Name (here is the name)
So if we run it for TLS module - it works fine. On the picture below we see how it works in C# console application and on the right - how it looks in PowerShell. Looks fair.
But everything changes if we try to lookup MSOnline module:
As we see - C# program gives no results, while PowerShell itself shows us that module is available.
I'm really confused. I thought that is something with my PC, but I have checked on some different ones including Server 2012 R2. Result is the same - this module can not be looked up via C# even if we use exactly the same command as in PS.
Has anyone seen such problem? If yes - what solution can be done to detect via C# if MSOnline PS module is present.
Thank you.

