"Object reference not set to an instance of an object" with commands to get values about vSwitch from vCenter 6.5 using PowerCLI 6.5.1
search cancel

"Object reference not set to an instance of an object" with commands to get values about vSwitch from vCenter 6.5 using PowerCLI 6.5.1

book

Article ID: 341747

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

Symptoms:
  • Executing  command to acquire the value of the standard switch with PowerCLI returns the following result.
< Command example 1 >
C:\Windows\system32> Get-VirtualSwitch
Get-VirtualSwitch : 20xx/xx/xx hh:mm:ss Get-VirtualSwitch  Object reference not set to an instance of an object.
At line:1 char:1
#NAME?
+ ~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-VirtualSwitch], VimException
    + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.Host.GetVirtualSwitch

< Command example 2 >
C:\Windows\system32> Get-VirtualSwitch -Standard
Get-VirtualSwitch : 20xx/xx/xx hh:mm:ss Get-VirtualSwitch  Object reference not set to an instance of an object.
At line:1 char:1
#NAME?
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-VirtualSwitch], VimException
    + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.Host.GetVirtualSwitch

< Command example 3 >
C:\Windows\system32> Get-VirtualPortGroup -Standard
Get-VirtualPortGroup : 20xx/xx/xx hh:mm:ss Get-VirtualPortGroup  Object reference not set to an instance of an object.
At line:1 char:1
#NAME?
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-VirtualPortGroup], VimException
    + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.Host.GetVirtualPortGroup
 
  • This issue does not affect vCenter Server 5.5 environment via PowerCLI 6.5.1.


Environment

VMware vCenter Server Appliance 6.5.x
VMware vCenter Server 6.5.x

Resolution

This issue is resolved in PowerCLI 11.2, available at VMware {Code}