You don't write scripts directly on vCenter. It has an API, there are libraries to access the API for many scripting languages. Pick a language of your choice, read it's documentation and write your script on any host you like.


You can use Vmware's PowerCLI tool. From Vmware, VMware PowerCLI is a command-line and scripting tool built on Windows PowerShell, and provides more than 800 cmdlets for managing and automating VMware vSphere, VMware Cloud Director, vRealize Operations Manager, vSAN, VMware NSX-T Data Center, VMware Cloud Services, VMware Cloud on AWS, VMware HCX, VMware ...


Use ${HOME} instead of ~, it is more portable. See this answer for details.


There are two different function syntaxes in bash/ksh/zsh. You're using the ksh style: function name { … }. The other form is just name() { … } and is the form introduced late in the original Bourne shell. It really is pointless to do: if cmd; then true else false fi Apart from turning all non-zero return statuses to 1, this is just ...


In order for the Powershell cmdlets to work properly using \\?\ You need to install the following minimum versions of these components (tested and validated on Windows Server 2012 R2): Windows Management Framework 5.1 (https://www.microsoft.com/en-us/download/details.aspx?id=54616) .NET Framework 4.6.2 (https://dotnet.microsoft.com/en-us/download/dotnet-...

Only top voted, non community-wiki answers of a minimum length are eligible