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
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
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
Thank you, I knew it was something simple, I just could not see it