I should modify this - this also fails for me on Server 2012 r2 / PS 5 / PowerCLI 6.5
Works for me.
Against which vCenter version are you running this?
vCenter Server 6.5 Update 1.
Never saw that one before, and I can't reproduce.
Did you have a closer look at the exception?
Do the following after the error
$error | Format-Custom -Depth 3
Perhaps that might give some more clues.
Btw, accessing Events through the Web Client works without an issue?
Thanks, LucD. Unfortunately, executing '$error | Format-Custom -Depth 3' shows the exact same error message as I originally posted - no change.
I suggest you open a SR, this looks like a "feature"
I'm seeing similar issue from Windows 10 (Powershell 5) w/ vCenter 6.5U1 as well.
Not sure if there is a connection, but I experienced the same at some point.
A restart of my VCSA seems to have fixed it at that time.
But still looks like a "feature" to me.
After some more testing, it seems very specific to PowerCLI 6.5. I was able to reproduce issue on a Windows 7 box running Powershell 5.1 w/ PowerCLI 6.5.x (MSI or PSGallery version). The issue does not show itself when I was running powerCLI 6.0R3 MSI install.
I'm not 100% sure it is PowerCLI related, my Get-VIEventPlus function, which uses the API method, had the problem as well.
I have a similar function to your get-vieventplus that errors out in the same way. I was thinking it might be a powershell version problem, but I tested from powershell 4.0-5.1 w/ PowerCLI 6.0R3 w/o any issues. The minute I installed 6.5 (either via MSI or PSGallery) those serialization errors began to appear.
It could of course be something in the vSphere framework that comes with PowerCLI.
Testing the API in the framework of another language could potentially confirm that.
Or perhaps calling the method via the MOB is already sufficient proof?
I definitely feel like it's something in PowerCLI 6.5, but it's very inconsistent. Like if I grabbed events for a vm object, it would return fine. If I grabbed all my $vmhosts and did a get-vievent, 1 or more may error out w/ deserialization errors. when I try to hit individually, some will work some won't.
The one consistent thing is that 6.0R3 doesn't exhibit these issues at all.
(I've been using a Fusion Windows 7 VM and keep snapping back to 6.0R3)
Did anyone get to the bottom of this?
I am getting this message too...
It is intermittent and time dependent, from the testing I have done using start and end dates/times and or maxsamples looks like there is an event type that could affect it.
Are any of you running something like Zerto or similar?
I have opened an SR but have been pushed towards "VMware Knowledge Base " SDK Support, but as this is a base command issue I don't see it falling there.
If there is an update I will update this ticket.