VMware Cloud Community
AlexP012
Contributor
Contributor

Hardware version 14 will not run Get-VIEvent

Hi

I'm running Vcenter 6.7 and I'm running some powerCLI version 11.2.0.12780525 on powershell 5.1.

When I run

Get-VIEvent -Entity Servername

it works if the server has a hardware version of 10 but if it has a version of 14 I get.

Get-VIEvent : 17/04/2019 15:13:20       Get-VIEvent             Exception has been thrown by the target of an invocation.

At line:1 char:1

+ Get-VIEvent -Entity gold_1

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

    + CategoryInfo          : NotSpecified: (:) [Get-VIEvent], VimException

    + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetEvent

Any Ideas?

Alex

0 Kudos
1 Reply
LucD
Leadership
Leadership

Seems to work fine for me.

$vmName = 'MyVM'

$vm = Get-VM -Name $vmName


$events = Get-VIEvent -Entity $vm -MaxSamples ([int]::MaxValue)

$vm | Select Version,@{N='Events';E={$events.Count}},

   @{N='PowerShell';E={$PSVersionTable.PSVersion.ToString()}},

   @{N='PCLI';E={(Get-Module -Name VMware.PowerCLI -ListAvailable | Sort-Object -Property Version | Select -last 1).Version}}

events.jpg

Which platform and which PS version are you using?


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

0 Kudos