VMware Cloud Community
mprobst2002
Contributor
Contributor
Jump to solution

.guest.toolstatus returning blank

I am trying to check the status and version of VMware tools in the beginning of a script, but the guest.toolsstatus value returns blank for me. I am not sure what I am missing. I tried running it from 2 different servers to be sure it was not my powercli install. I am planning to use an if then statement to upgrade virtual hardware once I verify tools status and version. I have been able to script the tools upgrade through VUM, but would like to check these before I upgrade. I am probably missing something simple, but I dont see it.

script:

$inputfile="E:\servers.txt"

$VMname = Get-Content $InputFile

ForEach($VMname in $VMname){

#check VMWare tools are running

$view = get-vm -name $VMname | Get-View

write-host $VMname

write-host $view.guest.toolstatus

write-host $view.config.tools.toolsversion

}

Output:

itlabvg860

7303

itlabvg861

8194

itlabvg862

8194

itlabvg863

8194

Thanks

Mike

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

I think you made a typo.

That should be (double s)

...
write-host $view.guest.toolsstatus
...

____________

Blog: LucD notes

Twitter: lucd22


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

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

I think you made a typo.

That should be (double s)

...
write-host $view.guest.toolsstatus
...

____________

Blog: LucD notes

Twitter: lucd22


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

0 Kudos
mprobst2002
Contributor
Contributor
Jump to solution

Thank you, I knew it was something simple, I just could not see it

0 Kudos