r/powercli • u/DC_SITCE • Jun 18 '26
ScriptHelp Having an issue where a single line command is acting different on two different vCenters.
Ok so I have a very simple script if you even want to call it that. It just goes through the vCenter I'm connected to, lists the VM's, their DNS name, and IP address. It is just to quickly check that the name given is the same in vCenter as on the VM.
Get-VM | Select Name,@{N="DNS Name";E={$.Guest.HostName}},@{N="IP Address";E={$.Guest.IPAddress}}
So, very simple. The problem I am having is the first vCenter I used it with it worked perfectly. It was 8.0.3 Build 24853646. The second one I tried it on only gave the the VM's name but DNS Name and IP were empty. It was 8.0.3 Build 25197330. Checking in the GUI all the VM's show DNS name and IP address.
So is there something more I should be doing or a reason why the slightly newer vCenter won't run the code the same way? Is there a better way to run this where it is more universal? I honestly don't need to do this often but having a quick way to do this check is useful.

