VMware Cloud Community
Davturo999
Contributor
Contributor

cant get output in powerCLI

Hello!  iam new in the use of powerCLI, and i was trying to run the next lines, only one at time.

picturee.png

and i cant get any output, no error, nothing i have been searching for the issue but i cant find a solution,

if i run other like .Guest.Disks i can get some output but .VMHost....

¡¡¡ thanks for the help !!!!

Labels (1)
Tags (1)
0 Kudos
17 Replies
LucD
Leadership
Leadership

What does the following return?

(Get-VM -Name <vmname>).VMHost
(Get-VM -Name <vmname>).VMHost | Get-Member


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

Tags (1)
0 Kudos
LucD
Leadership
Leadership

Also, what is that funny underscore at the end of each line that doesn't return anything?


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

0 Kudos
Davturo999
Contributor
Contributor

Hello! 

thanks for your quick answer.

 

When i execute the suggets commands, for the .VMHost y get nothing again but with the  | Get.Member y got this:

 

Get-Member : You must specify an object for the Get-Member cmdlet.
At line:1 char:33
+ (Get-VM <machinename>).VMHost | Get-Member
+ ~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Get-Member], InvalidOperationException
+ FullyQualifiedErrorId : NoObjectInGetMember,Microsoft.PowerShell.Commands.GetMemberCommand

 

 

 

0 Kudos
Davturo999
Contributor
Contributor

and about the funny underscore at the end of each line, thats a very good question.

0 Kudos
LucD
Leadership
Leadership

That looks as if there is nothing returned by

Get-VM <vmname>


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

0 Kudos
Davturo999
Contributor
Contributor

When i use the Get-VM | FL 

i get some data but also some white spaces, something like this:

 

MemoryMB : 16384

MemoryGB : 16
VMHostId   :
VMHost      :
VApp          :
FolderId     :
Folder        :

 

 

0 Kudos
Davturo999
Contributor
Contributor

also got this:

WARNING: The 'Version' property of VirtualMachine type is deprecated. Use the 'HardwareVersion' property instead

0 Kudos
LucD
Leadership
Leadership

That warning can be ignored in this.

Just wondering, do you have sufficient permissions to "see" all info for VM?
Which vSphere version are you using?
Are you connected to a vCenter or an ESXi node? Check what $global:defaultviservers contains


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

0 Kudos
Davturo999
Contributor
Contributor

it suppose, the user with i been entered it's admin but....

the suggest command "$global:default\viservers" give me this:

At line:1 char:16
+ $global:default\viservers
+ ~~~~~~~~~~
Unexpected token '\viservers' in expression or statement.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken

0 Kudos
LucD
Leadership
Leadership

That should have been

$global:defaultviservers


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

0 Kudos
Davturo999
Contributor
Contributor

that command give me back my user 

0 Kudos
LucD
Leadership
Leadership

It should also show where you are connected to


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

0 Kudos
Davturo999
Contributor
Contributor

yes it give me the port, i dont know what to do with this problem 

0 Kudos
Davturo999
Contributor
Contributor

the version its 5.0 its old but it's what we have 

0 Kudos
LucD
Leadership
Leadership

That is very old, that is not even available anymore.
Sorry, can't help you with that.
You definitely need to upgrade


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

0 Kudos
Davturo999
Contributor
Contributor

sadly, ok thanksyou anyways !

i'll continue asking for the solutions, 

 

0 Kudos
Davturo999
Contributor
Contributor

hey, i had found a solution for that, i use the powerCLI 5.0.1 and it works fine !

 

i hope we can get vSphere update soon, while i'll continue using this powerCLI version, 

0 Kudos