Get-Help: Object reference not set to an instance of an object

This topic contains 5 replies, has 2 voices, and was last updated by Profile photo of Aaron Jensen Aaron Jensen 8 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #34672
    Profile photo of Aaron Jensen
    Aaron Jensen
    Participant

    I'm having a weird issue with the Get-Help cmdlet on my computer. Whenever I want to view the help for an about topic, I get a NullRefernceException:

    
    > $Error[0] | fl * -force
    
    
    PSMessageDetails      :
    Exception             : System.NullReferenceException: Object reference not set to an instance of an object.
                               at System.Management.Automation.AnalysisCache.GetExportedClasses(String modulePath, ExecutionContext context)
                               at System.Management.Automation.PSClassSearcher.FindTypeByModulePath(WildcardPattern classNameMatcher)
                               at System.Management.Automation.PSClassSearcher.GetNextClass()
                               at System.Management.Automation.PSClassHelpProvider.d__17.MoveNext()
                               at System.Management.Automation.PSClassHelpProvider.d__e.MoveNext()
                               at System.Management.Automation.HelpSystem.d__b.MoveNext()
                               at System.Management.Automation.HelpSystem.d__0.MoveNext()
                               at Microsoft.PowerShell.Commands.GetHelpCommand.ProcessRecord()
                               at System.Management.Automation.CommandProcessor.ProcessRecord()
    TargetObject          :
    CategoryInfo          : NotSpecified: (:) [Get-Help], NullReferenceException
    FullyQualifiedErrorId : System.NullReferenceException,Microsoft.PowerShell.Commands.GetHelpCommand
    ErrorDetails          :
    InvocationInfo        : System.Management.Automation.InvocationInfo
    ScriptStackTrace      : at , : line 1
    PipelineIterationInfo : {}
    

    Is this a known issue? Has anyone encountered this before?

    PowerShell 5/Windows 7

    
    > $PSVersionTable
    
    Name                           Value                                                                                                                                                                                                                                      
    ----                           -----                                                                                                                                                                                                                                      
    PSVersion                      5.0.10586.51                                                                                                                                                                                                                               
    PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                                                                                    
    BuildVersion                   10.0.10586.51                                                                                                                                                                                                                              
    CLRVersion                     4.0.30319.34209                                                                                                                                                                                                                            
    WSManStackVersion              3.0                                                                                                                                                                                                                                        
    PSRemotingProtocolVersion      2.3                                                                                                                                                                                                                                        
    SerializationVersion           1.1.0.1
    
    #34673
    Profile photo of Don Jones
    Don Jones
    Keymaster

    Let's quickly confirm that you have no profile script, or that you're opening the shell using the switch to suppress profile loading. Also, is this in the console, the ISE, or both? And, has Update-Help been run recently?

    #34678
    Profile photo of Aaron Jensen
    Aaron Jensen
    Participant

    It happens in both the ISE and console. The same thing happens when I suppress profile loading. I get the same error when I run Update-Help.

    #34679
    Profile photo of Aaron Jensen
    Aaron Jensen
    Participant

    Since the problem was only with about topics, I figured the problem was with PowerShell looking through all the modules for about help topics. I slowly deleted/uninstalled modules one at a time to see if one of the modules was affecting this.

    It turns out I had a strange module with a GUID for a name and an empty .psd1 file. Not sure where this came from, but I imagine from some automated test that didn't properly clean up after itself.

    Once I deleted this "empty" module, Get-Help and Update-Help worked again.

    #34680
    Profile photo of Don Jones
    Don Jones
    Keymaster

    You should bug that on PowerShell's UserVoice page, including all the details you can since it's replicable. The system should fail a little more gracefully than bombing the entire help functionality.

    #34681
    Profile photo of Aaron Jensen
    Aaron Jensen
    Participant

    Posted. I didnt' see anywhere I could classify it as a bug, so I posted it as a "New Idea". http://windowsserver.uservoice.com/forums/301869-powershell/suggestions/11679417-get-help-cmdlet-fails-to-show-about-topics-when-in

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.