Here is a PowerCLI script that lists the datastore space utilization: Connect to vCenter server Connect-VIServer -Server -User -Password Get all the datastores in vCenter $datastores = Get-Datastore Loop through each datastore foreach ($datastore in $datastores) {# Get the capacity and free space of the datastore$capacity = $datastore.CapacityGB$freeSpace = $datastore.FreeSpaceGB # Calculate the used space … Continue reading PowerCLI script to list datastore space utilization
Tag: script
PowerShell script to list VMs on ESXi host.
Here is a PowerShell script to list the virtual machines (VMs) on an ESXi host: # Connect to the ESXi host Connect-VIServer -Server <ESXi_host_name> # Get a list of all VMs on the ESXi host $VMs = Get-VM # Loop through each VM and display its name and power state foreach ($VM in … Continue reading PowerShell script to list VMs on ESXi host.