You can automate this with the help of SCCM and VBscript, but as LucD said, you can't in PowerCLI :smileysad:
Copy "windows.iso" image from your ESXi host (in 5.0.0 its "/vmimages/tools-isoimages") to local directory, and extract its contents to "VMware Tools" directory.
' VMware Tools installation script.
' Reference for Unattended Installation of VMware Tools in Windows:
' http://communities.vmware.com/servlet/JiveServlet/downloadBody/12413-102-4-13370/VMware%20Tools%20-%20Unattended_Install.pdf
Option Explicit
Dim objFSO, objFolder, wshShell, oShellLink, strScriptPath, strLogLocation, strLogFile
Dim strOptions, strCommandLine, strEXE, strRegKey, blnRemoveThinPrintDriver, strvalue
Dim strProcessorArchitecture, blnNewInstall, strAllUsersProfile, timevalue
'********** These are the script variables that can be changed **********
' Setting this to false will not remove the Thin Print driver.
blnRemoveThinPrintDriver = WScript.Arguments.Item(0)
' Set the log file location
strLogLocation = "%SystemDrive%\logs"
strScriptPath = Left(Wscript.ScriptFullName, (InstrRev(Wscript.ScriptFullName, "\")))
timevalue = Now
' Set the log file name
strLogFile = "VMwareTools" & "-" & Year(timevalue) & "-" & Month(timevalue) & "-" & Day(timevalue) & "-" & Hour(timevalue) & "-" & Minute(timevalue) & "-" & Second(timevalue) & ".log"
'************************************************************************
set WshShell = WScript.CreateObject("WScript.Shell")
set objFSO = CreateObject("Scripting.FileSystemObject")
strLogLocation = WshShell.ExpandEnvironmentStrings(strLogLocation)
' Create the log file folder
If NOT objFSO.FolderExists(strLogLocation) Then
objFSO.CreateFolder(strLogLocation)
End If
strProcessorArchitecture = WshShell.ExpandEnvironmentStrings("%PROCESSOR_ARCHITECTURE%")
strAllUsersProfile = WshShell.ExpandEnvironmentStrings("%ALLUSERSPROFILE%")
' Building the MSIEXEC command line options
strOptions = " /S /v " & chr(34) & "ALLUSERS=TRUE ADDLOCAL=Audio,BootCamp,PVSCSI,Sync,VShield,VMXNet,VMXNet3,VSS,MemCtl,Mouse,MouseUsb,Perfmon,SVGA,TrayIcon,VMCI /qn REBOOT=R /L " & chr(34) & strLogLocation & "\" & strLogFile & chr(34)
' Check if ThinPrint should be installed or not
If blnRemoveThinPrintDriver Then
strOptions = strOptions & " REMOVE=" & chr(34) & "Hgfs,WYSE,GuestSDK,vmdesched,ThinPrint" & chr(34)
Else
strOptions = strOptions & " REMOVE=" & chr(34) & "Hgfs,WYSE,GuestSDK,vmdesched," & chr(34)
End If
If strProcessorArchitecture = "x86" Then
strEXE = "Setup.exe"
Else
strEXE = "Setup64.exe"
End If
' Installing VMware Tools with the relevant command line options
strCommandLine = chr(34) & strScriptPath & "VMware Tools\" & strEXE & chr(34) & strOptions & chr(34)
' wscript.echo strCommandLine
WshShell.Run strCommandLine,1,True
Set WshShell = Nothing
set objFSO = Nothing
WScript.Quit(0)
Create a list of VMs in a txt file and in SCCM you can create your own package and make them run against the server list.
This script does both install and update, where required.