VMware Cloud Community
gregharms
Contributor
Contributor
Jump to solution

PowerCLI 6.5.1 seems to break PowerShell Help

I'm unable to run PowerShell help cmdlets after installing PowerCLI 6.5.1. More specifically, when modules "VMware.VimAutomation.Common" and "VMware.PowerCLI" are present in my user's Modules folder, get-help crashes with the following error:

get-help : Object reference not set to an instance of an object.

At line:1 char:1

+ get-help about_functions_advanced_parameters

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Get-Help], NullReferenceException

    + FullyQualifiedErrorId : System.NullReferenceException,Microsoft.PowerShell.Commands.GetHelpCommand

PowerShell help works after I remove those two modules from the Modules folder.

To reproduce on my workstation,

  1. Deleted all VMware.* folders in my modules folder.
  2. Used "get-module -ListAvailable" to confirm the VMware modules were not available in any of the PowerShell modules paths.
  3. Ran "get-help about_functions_advanced_parameters" to confirm PowerShell Help was functional.
  4. Ran "install-module -Scope CurrentUser -Repository PSGallery -Name VMware.PowerCLI" to install latest version of PowerCLI.
  5. Ran "get-help about_functions_advanced_parameters" and PowerShell barks with the error I noted above.
  6. Deleted  "VMware.VimAutomation.Common" and "VMware.PowerCLI" folders.
  7. Ran "get-help about_functions_advanced_parameters" again and PowerShell Help is working again. Of course, PowerCLI now won't be working until I restore the folders I deleted.

Anyone else having this trouble?

PSVersion 5.0.10586.672 on Windows 10

Tags (1)
Reply
0 Kudos
1 Solution

Accepted Solutions
gregharms
Contributor
Contributor
Jump to solution

To isolate to those two modules, I took the old MacOS extensions troubleshooting trick by removing modules in large groups until PowerShell help worked again. By remove, I mean I moved the module's folder outside my PSModulesPath. Then added them back in smaller groups till PowerShell Help broke again. Eventually got it down to just those two modules...both had to be removed from my modules folder for Help to work. Sanitized copy of my profile is attached too.

I'm happy to note that my workstation is now running Win10 version 1607. PSVersion is at 5.1.14393.206. And now I can use PowerShell Help while all the modules for PowerCLI 6.5.1 are installed. Yay!

So my problem seems to stem from the PowerShell 5.0 code present on Windows 10 version 1511.

View solution in original post

Reply
0 Kudos
5 Replies
LucD
Leadership
Leadership
Jump to solution

What do you have in yoru PSModulePath?

Do a

$env:PSModulePath.Split(';')

Did you stop/start your PowerShell session after step 4?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
gregharms
Contributor
Contributor
Jump to solution

PSModulePath - ;C:\Users\HARMSG\Documents\WindowsPowerShell\Modules;C:\Program Files (x86)\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files (x86)\Microsoft SQL Server\130\Tools\PowerShell\Modules\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\PowerShell\Modules\

Once PowerCLI 6.5.1 modules are available in my PSModulePath, this issue appears in existing PowerShell sessions and new ones.

The error is very much like an error posted to UserVoice

Get-Help cmdlet fails to show about topics when invalid module is installed – Windows Server

I'm using an enterprise-controlled version of Windows 10. It's still build 1511 (might see 1607 in late summer...). Since 1511 was first released prior to the post about the "fix" on the insiders build, I suspect I'm running into that bug because my workstation hasn't been allowed to upgrade to a build with the fix yet.

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Yes, looks like that bug.
Keep us informed on the outcome.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
jakerpowercli
VMware Employee
VMware Employee
Jump to solution

Hey Greg!

How did you determine that removing `vmware.vimautomation.common` and `vmware.powercli` were what was causing the issue?

Also, can you share your powershell profile? Just curious to see if I can reproduce the issue.

Reply
0 Kudos
gregharms
Contributor
Contributor
Jump to solution

To isolate to those two modules, I took the old MacOS extensions troubleshooting trick by removing modules in large groups until PowerShell help worked again. By remove, I mean I moved the module's folder outside my PSModulesPath. Then added them back in smaller groups till PowerShell Help broke again. Eventually got it down to just those two modules...both had to be removed from my modules folder for Help to work. Sanitized copy of my profile is attached too.

I'm happy to note that my workstation is now running Win10 version 1607. PSVersion is at 5.1.14393.206. And now I can use PowerShell Help while all the modules for PowerCLI 6.5.1 are installed. Yay!

So my problem seems to stem from the PowerShell 5.0 code present on Windows 10 version 1511.

Reply
0 Kudos