What kind of pre-requisite are you talking about?
Prerequisite to unmount a datastore.
Like, checking if a vm exist, SIOC enabled,part of heartbeat ...
I need to do these prechecks for multiple datastores (100+) and then unmount and delete.
Ok, for the pre-requisites you could use the function I provided in Test If The Datastore Can Be Unmounted
To unmount a datastore you have to use the API methods or use the esxcli (see KB2004605) commands.
The API methods were packaged in functions by Alan, see Datastore Mount/Unmount Detach/Attach functions
The esxcli commands can be done through Get-EsxCli.
Both will work, the functions have the advantage that they will make sure the datastore is unmounted on all connected ESXi nodes.
With the esxcli commands you will have run these commands on each connected ESXi node.
Thanks a lot Luc,
I was able to convert your script to fetch information from multiple datastores,at the same time, and it worked well.