A set of functions to allow you to unmount/mount and detach/attach datastores from multiple hosts.
List all datastores and their mount/detach status by passing your datastore object(s) into the Get-DatastoreMountInfo advanced function as shown below:
To unmount a datastore pass your datastore object(s) to the Unmount-Datastore advanced function as seen below, this will unmount the datastore from all attached hosts:
Once unmounted you will then be able to detach the datastore from the hosts using the Detach-Datastore cmdlet as shown below:
Script download
https://communities.vmware.com/servlet/JiveServlet/download/18008-1-78898/DatastoreFunctions.txt
Forward from
https://communities.vmware.com/docs/DOC-18008
转载于:https://blog.51cto.com/549687/1983749