VMware Cloud Community
pezh0re
Enthusiast
Enthusiast

Unhandled Exception: Cannot print exception string because Exception.ToString() failed.

I'm using the latest PowerCLI module with the latest PowerShell console, and periodically I'm getting exceptions in my code that will throw the titular error:

Unhandled Exception:
     Cannot print exception string because Exception.ToString() failed.

It appears in a few different places - sometimes when attempting to Get-VMQuestion, other times while gathering details about a vCenter VM. Specific software versions below:

R:\Source> Get-PowerCLIVersion
WARNING: The cmdlet "Get-PowerCLIVersion" is deprecated. Please use the 'Get-Module' cmdlet instead.


PowerCLI Version
----------------
   VMware PowerCLI 6.5.1 build 5377412
---------------
Component Versions
---------------
   VMware Cis Core PowerCLI Component 6.5 build 5374323
   VMware VimAutomation Core PowerCLI Component 6.5 build 5374329


R:\Source> $PSversiontable


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

Has anyone seen this before? If I attempt to catch the error, the $Error variable is null.

Reply
0 Kudos
1 Reply
LucD
Leadership
Leadership

This looks like a .Net Core issue (see #3858).

Do you have .Net Core installed on the box?

Do you see this on several stations?


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

Reply
0 Kudos