Missing Modules and Snapins in Object Browser

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 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.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: Missing Modules and Snapins in Object Browser

Post by davidc » Mon Apr 18, 2016 8:14 am

We just wanted check the log information to see if any module information was listed.

Another user with the same issue rebuilt his OS and the issue was resolved. It is possible that something in PowerShell or .NET is corrupted, because it seems the Get-Module -ListAvailable is failing in the caching process. Otherwise the V5 Module log would contain a list of modules.


If you are willing, we can send you a test component that includes extra logging.

David
David
SAPIEN Technologies, Inc.

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: Missing Modules and Snapins in Object Browser

Post by davidc » Mon Apr 18, 2016 11:06 am

We sent you an email with links and instructions on how to use the diagnostic version of the component.

David
David
SAPIEN Technologies, Inc.

User avatar
Crille_77
Posts: 13
Joined: Sun Mar 03, 2013 12:41 pm

Re: Missing Modules and Snapins in Object Browser

Post by Crille_77 » Tue Apr 19, 2016 3:10 am

Hi!

I have now followed your instructions and here comes the new logs... Se the attached zip file.

When I looked into the log files, Your new version of the dll didn't tell much more information....
Attachments
Local Machine.zip
Local Machine
(201.46 KiB) Downloaded 57 times

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: Missing Modules and Snapins in Object Browser

Post by davidc » Tue Apr 19, 2016 8:48 am

It confirms that PowerShell is not returning any modules when the CacheBuilder issues the Get-Module -ListAvailable command. I don't know why this is the case on your machine, but I suspect that some other setting is causing this.

Let's look at the PSModulePath values and see what we can find. Please run the following script and post the results:

Code: Select all

"User:"
[Environment]::GetEnvironmentVariable('PSModulePath', 'User').split(";")
"Machine:"
[Environment]::GetEnvironmentVariable('PSModulePath', 'Machine').split(";")
"Process:"
[Environment]::GetEnvironmentVariable('PSModulePath', 'Process').split(";")

David
David
SAPIEN Technologies, Inc.

User avatar
Crille_77
Posts: 13
Joined: Sun Mar 03, 2013 12:41 pm

Re: Missing Modules and Snapins in Object Browser

Post by Crille_77 » Wed Apr 20, 2016 12:30 am

Here comes the output:
PS C:\Users\XXXXXX> [Environment]::GetEnvironmentVariable("PSModulePath", "User").split(";")
You cannot call a method on a null-valued expression.
At line:1 char:1
+ [Environment]::GetEnvironmentVariable("PSModulePath", "User").split(" ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull


PS C:\Users\XXXXXX> [Environment]::GetEnvironmentVariable("PSModulePath", "Machine").split(";")
C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\
C:\Program Files (x86)\Microsoft SQL Server\120\Tools\PowerShell\Modules\
C:\Program Files\Intel\
C:\Program Files\WindowsPowerShell\Modules\
C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager\
C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\

PS C:\Users\XXXXXX> [Environment]::GetEnvironmentVariable("PSModulePath", "Process").split(";")
C:\Users\XXXXXX\Documents\WindowsPowerShell\Modules
C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\
C:\Program Files (x86)\Microsoft SQL Server\120\Tools\PowerShell\Modules\
C:\Program Files\Intel\
C:\Program Files\WindowsPowerShell\Modules\
C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager\
C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\

User avatar
Crille_77
Posts: 13
Joined: Sun Mar 03, 2013 12:41 pm

Re: Missing Modules and Snapins in Object Browser

Post by Crille_77 » Wed Apr 20, 2016 12:43 am

The same but from inside PS Studio Console:

User:
[Environment]::GetEnvironmentVariable('PSModulePath', 'User').split(";")
You cannot call a method on a null-valued expression.
At line:1 char:1
+ [Environment]::GetEnvironmentVariable('PSModulePath', 'User').split(" ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

Machine:
[Environment]::GetEnvironmentVariable('PSModulePath', 'Machine').split(";")
C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\
C:\Program Files (x86)\Microsoft SQL Server\120\Tools\PowerShell\Modules\
C:\Program Files\Intel\
C:\Program Files\WindowsPowerShell\Modules\
C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager\
C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\

Process:
[Environment]::GetEnvironmentVariable('PSModulePath', 'Process').split(";")
C:\Users\XXXXXXXX\Documents\WindowsPowerShell\Modules
C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\
C:\Program Files (x86)\Microsoft SQL Server\120\Tools\PowerShell\Modules\
C:\Program Files\Intel\
C:\Program Files\WindowsPowerShell\Modules\
C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager\
C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: Missing Modules and Snapins in Object Browser

Post by davidc » Wed Apr 20, 2016 11:07 am

The fact that PowerShell is reporting no modules has me stumped.
You said when you ran Get-Module -ListAvailable in PowerShell Studio (not the console) it returns results, yet it makes no sense that the caching process is not getting any results.

Let's try something:

1. Go to PowerShell Studio's folder:

C:\Program Files\SAPIEN Technologies, Inc\PowerShell Studio 2016

2. Right Click the CacheManager.exe and select "Run as administrator" from the context menu.

3. Also try running the cache under another user profile (if you have multiple users on the machine), to see if this issue is related to the current user account.

David
David
SAPIEN Technologies, Inc.