VMware Cloud Community
wesley_yalipu
Enthusiast
Enthusiast
Jump to solution

PowerCLI version 10.0.0.7895300 and 10.1.0.8403314 throws error message when running cmdlets

Hi,

I just made a couple of tests using different versions of PowerCLI and I keep getting a strange error message.

Some cmdlets will still run correctly as far as I see but some will fail.

With module 10.0.0.7895300 and 10.1.0.8403314 :

Any cmdlets will throw the error below.

Get-View : Value cannot be null.

Parameter name: format

At line:1 char:1

+ Get-View -ViewType Datacenter

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

    + CategoryInfo          : NotSpecified: (:) [Get-View], ArgumentNullException

    + FullyQualifiedErrorId : System.ArgumentNullException,VMware.VimAutomation.ViCore.Cmdlets.Commands.DotNetInterop.GetVIView

Even the "Disconnect-VIServer" will throw the same error.

With the module 6.5.4.7155375 :

Everything work as expected.

Detail of the error message :

$Error[0].Exception | fl * -Force

Message        : Value cannot be null.

                 Parameter name: format

ParamName      : format

Data           : {}

InnerException :

TargetSite     : System.String FormatHelper(System.IFormatProvider, System.String, System.ParamsArray)

StackTrace     :    at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)

                    at VMware.VimAutomation.Sdk.Util10Ps.BaseCmdlet.MessageHelper.ThrowTerminatingError(Exception ex, String connectionId)

                    at VMware.VimAutomation.ViCore.Util10Ps.BaseCmdlet.BaseCmdlet.ProcessRecordErrorHandled()

                    at VMware.VimAutomation.ViCore.Cmdlets.Commands.DotNetInterop.GetVIView.ProcessRecordErrorHandled()

                    at VMware.VimAutomation.Sdk.Util10Ps.BaseCmdlet.ErrorCallbackCmdletBase.ProcessRecord()

                    at System.Management.Automation.CommandProcessor.ProcessRecord()

HelpLink       :

Source         : mscorlib

HResult        : -2147467261

Tests done under Microsoft Windows 10 Enterprise (10.0.15063) - 1703. OS is fully patched by MS update.

Powershell version :

Name                       Value
----                       -----
PSVersion                  5.1.15063.1112
PSEdition                  Desktop
PSCompatibleVersions       {1.0, 2.0, 3.0, 4.0...}
BuildVersion               10.0.15063.1112
CLRVersion                 4.0.30319.42000
WSManStackVersion          3.0
PSRemotingProtocolVersion  2.3
SerializationVersion       1.1.0.1

Using the module version 10* under PowerShell v6 is ok, the cmdlets are working as expected.

Is this a known incompatibility ? I saw some comments about this error in the powershell gallery.

Thank you,

Wesley

0 Kudos
1 Solution

Accepted Solutions
wesley_yalipu
Enthusiast
Enthusiast
Jump to solution

Thanks for the reply LucD. Unfortunately, I never installed PowerCLI using the MSI installer. This is a fresh install of Windows and I updated the modules through "Update-Module" cmdlets.

It used to work correctly on my old laptop (Windows 10 1709).

I actually fixed my issue this morning.

I upgraded my Windows 10 from 1703 to 1803 and after testing again the v10.1, it now works correctly.

There's an issue with the "mscorlib" DLL when using a Windows 10 inferior to 1709.

Regards,

Wesley.

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

No, PowerCLI 10.* works perfectly under PowerShell 5.1.

I suspect there might be something wrong with your installation of the PowerCLI modules.

Can you completely uninstall, including possible remnants from a previous MSI-based installation.

Use the Welcome PowerCLI to the PowerShell Gallery – Install Process Updates and Updating PowerCLI through the PowerShell Gallery posts for instructions.


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

0 Kudos
wesley_yalipu
Enthusiast
Enthusiast
Jump to solution

Thanks for the reply LucD. Unfortunately, I never installed PowerCLI using the MSI installer. This is a fresh install of Windows and I updated the modules through "Update-Module" cmdlets.

It used to work correctly on my old laptop (Windows 10 1709).

I actually fixed my issue this morning.

I upgraded my Windows 10 from 1703 to 1803 and after testing again the v10.1, it now works correctly.

There's an issue with the "mscorlib" DLL when using a Windows 10 inferior to 1709.

Regards,

Wesley.

0 Kudos