Skip to content

VirtuallyThatGuy

Anything VMware , PowerCLI, PowerShell, Automation and some Windows

Menu
  • Home
  • PowerCLI
  • VMware
  • Automation
  • Windows
  • About
Menu

VMware Must Have Powershell Commands – Useful VIProperty cmdlets for VMware Powercli – How to add cmdlets to Powershell Profile VMWare – VirtuallyThatGuy

Posted on 10 January 20216 December 2022 by VirtuallyThatGuy

These are useful and must VI property cmdlets for automation.

# VIProperty cmdlet For VMWare Powercli

#Cluster
# NumberOfHosts

New-VIProperty -Name NumberOfHosts -ObjectType Cluster `
-Value {
param($cluster)
@($cluster.Extensiondata.Host).Count
} `
-BasedOnExtensionProperty 'Host' `
-Force

New-VIProperty -Name NumberOfHosts -ObjectType Cluster `
	-Value {
		param($cluster)
 
		@($cluster.Extensiondata.Host).Count
	} `
	-BasedOnExtensionProperty 'Host' `
	-Force

#NumberOfVMs

New-VIProperty -Name NumberOfVMs -ObjectType Cluster `
-Value {
param($cluster)
($cluster.Extensiondata.Host | %{Get-View $_} | `
Measure-Object -InputObject {$_.Vm.Count} -Sum).Sum
} `
-BasedONextensionProperty 'Host' `
-Force


New-VIProperty -Name NumberOfVMs -ObjectType Cluster `
	-Value {
		param($cluster)
 
		($cluster.Extensiondata.Host | %{Get-View $_} | `
		Measure-Object -InputObject {$_.Vm.Count} -Sum).Sum
	} `
	-BasedONextensionProperty 'Host' `
	-Force

#NumberVmotions

New-VIProperty -Name NumberVmotions -ObjectType Cluster -Value {
param($cluster)
$cluster.ExtensionData.Summary.NumVmotions
} -Force


New-VIProperty -Name NumberVmotions -ObjectType Cluster -Value {
	param($cluster)
 
	$cluster.ExtensionData.Summary.NumVmotions
} -Force

#NumCPU

New-VIProperty -Name NumCPU -ObjectType Cluster `
-Value {
$TotalPCPU = 0
$Args[0] | Get-VMHost | foreach {
$TotalPCPU += $_.NumCPU
}
$TotalPCPU
} -Force



New-VIProperty -Name NumCPU -ObjectType Cluster `
   -Value {
      $TotalPCPU = 0
 
      $Args[0] | Get-VMHost | foreach {
         $TotalPCPU += $_.NumCPU
      }
   $TotalPCPU
} -Force
NumPoweredOnvCPUs
Credit: Alan Renouf

New-VIProperty -ObjectType Cluster -name NumPoweredOnvCPUs `
-Value {
$TotalvCPU = 0
$Args[0] | Get-VMHost | foreach {
$TotalvCPU += $_.NumPoweredOnvCPUs
}
$TotalvCPU
} -Force


New-VIProperty -ObjectType Cluster -name NumPoweredOnvCPUs `
	-Value {
		$TotalvCPU = 0
		$Args[0] | Get-VMHost | foreach {
			$TotalvCPU += $_.NumPoweredOnvCPUs
		}
		$TotalvCPU
 } -Force

#NumvCPUs

New-VIProperty -Name NumvCPUs -ObjectType Cluster `
-Value {
$TotalvCPU = 0
$Args[0] | Get-VMHost | foreach {
$TotalvCPU += $_.NumvCPUs
}
$TotalvCPU
} -Force


New-VIProperty -Name NumvCPUs -ObjectType Cluster `
	-Value {
		$TotalvCPU = 0
		$Args[0] | Get-VMHost | foreach {
			$TotalvCPU += $_.NumvCPUs
		}
		$TotalvCPU
 } -Force

#Datastore
#CapacityGB

New-VIProperty -Name CapacityGB -ObjectType Datastore `
-Value {
param($ds)
[Math]::Round($ds.CapacityMB/1KB,1)
} `
-Force


New-VIProperty -Name CapacityGB -ObjectType Datastore `
	-Value {
		param($ds)
 
		[Math]::Round($ds.CapacityMB/1KB,1)
	} `
	-Force
FreeGB
New-VIProperty -Name FreeGB -ObjectType Datastore `
-Value {
param($ds)
[Math]::Round($ds.FreeSpaceMb/1KB,1)
} `
-Force


New-VIProperty -Name FreeGB -ObjectType Datastore `
	-Value {
		param($ds)
 
		[Math]::Round($ds.FreeSpaceMb/1KB,1)
	} `
	-Force


New-VIProperty -Name NumberOfVMs -ObjectType Datastore `
-Value {
param($ds)
$ds.ExtensionData.VM.Length
} `
-Force


New-VIProperty -Name NumberOfVMs -ObjectType Datastore `
	-Value {
		param($ds)
 
		$ds.ExtensionData.VM.Length
	} `
	-Force
PercentFree
Credit: Sean Duffy

New-VIProperty -Name PercentFree -ObjectType Datastore -Value {
param($ds)
"{0:P2}" -f ($ds.FreeSpaceMB/$ds.CapacityMB)
} -Force


New-VIProperty -Name PercentFree -ObjectType Datastore -Value {
	param($ds)
 
	"{0:P2}" -f ($ds.FreeSpaceMB/$ds.CapacityMB)
} -Force
ProvisionedGB
New-VIProperty -Name ProvisionedGB -ObjectType Datastore `
-Value {
param($ds)
[Math]::Round(($ds.ExtensionData.Summary.Capacity - $ds.ExtensionData.Summary.FreeSpace + $ds.ExtensionData.Summary.Uncommitted)/1GB,1)
} `
-BasedONextensionProperty 'Summary' `
-Force


New-VIProperty -Name ProvisionedGB -ObjectType Datastore `
	-Value {
		param($ds)
 
		[Math]::Round(($ds.ExtensionData.Summary.Capacity - $ds.ExtensionData.Summary.FreeSpace + $ds.ExtensionData.Summary.Uncommitted)/1GB,1)
	} `
	-BasedONextensionProperty 'Summary' `
	-Force


New-VIProperty -Name Datastore -ObjectType Harddisk -Value {
param($hd)
$hd.Filename.Split(']')[0].TrimStart('[')
} -Force


New-VIProperty -Name Datastore -ObjectType Harddisk -Value {
	param($hd)
 
	$hd.Filename.Split(']')[0].TrimStart('[')
} -Force


New-VIProperty -Name UnitNumber -ObjectType Harddisk `
-ValueFromExtensionProperty 'UnitNumber' -Force


New-VIProperty -Name UnitNumber -ObjectType Harddisk `
	-ValueFromExtensionProperty 'UnitNumber' -Force


New-VIProperty -Name LinkState -ObjectType PhysicalNic -Value {
param($nic)
if($nic.Extensiondata.LinkSpeed){"up"}else{"down"}
} -Force



New-VIProperty -Name LinkState -ObjectType PhysicalNic -Value {
	param($nic)
 
	if($nic.Extensiondata.LinkSpeed){"up"}else{"down"}
} -Force


New-VIProperty -Name vCenterServer `
-ObjectType DistributedPortgroup,VirtualPortgroup `
-Value {
$Args[0].Uid.Split(':')[0].Split('@')[1]
} -Force


New-VIProperty -Name vCenterServer `
	-ObjectType DistributedPortgroup,VirtualPortgroup `
	-Value {
		$Args[0].Uid.Split(':')[0].Split('@')[1]
	} -Force



New-VIProperty -Name Harddisk -ObjectType ScsiController -Value {
param($sc)
foreach($device in $sc.ExtensionData.Device){
($sc.Parent.ExtensionData.Config.Hardware.Device | `
where {$_.Key -eq $device}).DeviceInfo.Label
}
} -Force


New-VIProperty -Name Harddisk -ObjectType ScsiController -Value {
	param($sc)
 
	foreach($device in $sc.ExtensionData.Device){
		($sc.Parent.ExtensionData.Config.Hardware.Device | `
		where {$_.Key -eq $device}).DeviceInfo.Label
	}
} -Force


New-VIProperty -Name lunDatastoreName -ObjectType ScsiLun -Value {
param($lun)
$ds = $lun.VMHost.ExtensionData.Datastore | %{Get-View $_} |
where {$_.Summary.Type -eq "VMFS" -and
($_.Info.Vmfs.Extent | where {$_.DiskName -eq $lun.CanonicalName})}
if($ds){
$ds.Name
}
} -Force


New-VIProperty -Name lunDatastoreName -ObjectType ScsiLun -Value {
  param($lun)
 
  $ds = $lun.VMHost.ExtensionData.Datastore | %{Get-View $_} |
    where {$_.Summary.Type -eq "VMFS" -and
      ($_.Info.Vmfs.Extent | where {$_.DiskName -eq $lun.CanonicalName})}
    if($ds){
      $ds.Name
    }
} -Force


New-VIProperty -Name "Datacenter" -ObjectType Snapshot `
-Value {
param ($Snapshot)
Get-Datacenter -VM ($Snapshot.VM)
} -Force



New-VIProperty -Name "Datacenter" -ObjectType Snapshot `
 -Value {
  param ($Snapshot)
  Get-Datacenter -VM ($Snapshot.VM)
 } -Force


New-VIProperty -Name "DaysOld" -ObjectType Snapshot `
-Value {
param ($Snapshot)
((Get-Date) - $Snapshot.Created).Days
} -Force


New-VIProperty -Name "DaysOld" -ObjectType Snapshot `
 -Value {
  param ($Snapshot)
  ((Get-Date) - $Snapshot.Created).Days
 } -Force



New-VIProperty -Name "vCenter" -ObjectType Snapshot `
-Value {
param ($Snapshot)
([Uri](Get-VM $Snapshot.VM).ExtensionData.Client.ServiceUrl).Host
} -Force


New-VIProperty -Name "vCenter" -ObjectType Snapshot `
 -Value {
  param ($Snapshot)
  ([Uri](Get-VM $Snapshot.VM).ExtensionData.Client.ServiceUrl).Host
 } -Force
VirtualMachine
BootDelay
New-VIProperty -Name "BootDelay" -ObjectType VirtualMachine `
-Value {
param($vm)
$vm.ExtensionData.Config.BootOptions.BootDelay
}  -BasedOnExtensionProperty "Config.BootOptions" `
-Force


New-VIProperty -Name "BootDelay" -ObjectType VirtualMachine `
	-Value {
		param($vm)
 
		$vm.ExtensionData.Config.BootOptions.BootDelay
	}  -BasedOnExtensionProperty "Config.BootOptions" `
	-Force



New-VIProperty -Name BootTime -ObjectType VirtualMachine `
-Value {
param($vm)
$vm.ExtensionData.Summary.Runtime.BootTime.ToLocalTime()
} -Force


New-VIProperty -Name BootTime -ObjectType VirtualMachine `
  -Value {
    param($vm)
    $vm.ExtensionData.Summary.Runtime.BootTime.ToLocalTime()
  } -Force



New-VIProperty -Name CBTEnabled -ObjectType VirtualMachine `
-ValueFromExtensionProperty "Config.ChangeTrackingEnabled" `
-Force


New-VIProperty -Name CBTEnabled -ObjectType VirtualMachine `
  -ValueFromExtensionProperty "Config.ChangeTrackingEnabled" `
  -Force



New-VIProperty -Name 'CpuHotAddEnabled' `
-BasedOnExtensionProperty 'Config.ExtraConfig' `
-ObjectType VirtualMachine `
-Value {
param($vm)
[bool]( $vm.ExtensionData.Config.ExtraConfig | `
? { $_.key -eq 'vcpu.hotadd' }).Value
} -warningAction 'silentlycontinue' -Force


New-VIProperty -Name 'CpuHotAddEnabled' `
	-BasedOnExtensionProperty 'Config.ExtraConfig' `
	-ObjectType VirtualMachine `
	-Value {
		param($vm)
		[bool]( $vm.ExtensionData.Config.ExtraConfig | `
			? { $_.key -eq 'vcpu.hotadd' }).Value
	} -warningAction 'silentlycontinue' -Force



New-VIProperty -Name DNSName -ObjectType VirtualMachine -Value {
param($vm)
$vm.ExtensionData.Guest.Hostname
} -BasedOnExtensionProperty "Guest.Hostname" -Force


New-VIProperty -Name DNSName -ObjectType VirtualMachine -Value {
	param($vm)
 
	$vm.ExtensionData.Guest.Hostname
} -BasedOnExtensionProperty "Guest.Hostname" -Force
MemoryHotAddEnabled
Credit: Hal Rottenberg

New-VIProperty -Name 'MemoryHotAddEnabled' `
-BasedOnExtensionProperty 'Config.ExtraConfig' `
-ObjectType VirtualMachine `
-Value {
param($vm)
[bool]( $vm.ExtensionData.Config.ExtraConfig | `
? { $_.key -eq 'mem.hotadd' }).Value
} -WarningAction 'silentlycontinue' -Force


New-VIProperty -Name 'MemoryHotAddEnabled' `
	-BasedOnExtensionProperty 'Config.ExtraConfig' `
	-ObjectType VirtualMachine `
	-Value {
		param($vm)
		[bool]( $vm.ExtensionData.Config.ExtraConfig | `
			? { $_.key -eq 'mem.hotadd' }).Value
	} -WarningAction 'silentlycontinue' -Force



New-VIProperty -Name MemReservation -ObjectType VirtualMachine `
-Value {
param($vm)
$vm.ExtensionData.Summary.Config.memoryReservation
} -Force


New-VIProperty -Name MemReservation -ObjectType VirtualMachine `
	-Value {
		param($vm)
 
		$vm.ExtensionData.Summary.Config.memoryReservation
	} -Force



New-VIProperty -Name NumVirtualDisks -ObjectType VirtualMachine `
-Value {
param($vm)
$vm.ExtensionData.Summary.Config.numVirtualDisks
} -Force


New-VIProperty -Name NumVirtualDisks -ObjectType VirtualMachine `
	-Value {
		param($vm)
 
		$vm.ExtensionData.Summary.Config.numVirtualDisks
	} -Force




New-VIProperty -Name "OSName" -ObjectType VirtualMachine -Value {
param($vm)
$vm.ExtensionData.Guest.GuestFullName
} -BasedOnExtensionProperty "Guest.GuestFullName" -Force



New-VIProperty -Name "OSName" -ObjectType VirtualMachine -Value {
	param($vm)
 
	$vm.ExtensionData.Guest.GuestFullName
	} -BasedOnExtensionProperty "Guest.GuestFullName" -Force
SnapshotSpaceUsed
Ignore the warning about the ‘$_’ variable

New-VIProperty -Name SnapshotSpaceUsed -ObjectType VirtualMachine -Value {
param($vm)
$fileList = $vm.ExtensionData.LayoutEx.Disk | %{
$_.Chain | Select -Skip 1 | %{
$_.FileKey | %{
$_
}
}
}
$vm.ExtensionData.LayoutEx.File | where{$fileList -contains $_.Key} | %{
$snapSize += $_.Size
}
$snapSize
} -Force -BasedOnExtensionProperty 'LayoutEx'



New-VIProperty -Name SnapshotSpaceUsed -ObjectType VirtualMachine -Value {
	param($vm)
 
	$fileList = $vm.ExtensionData.LayoutEx.Disk | %{
		$_.Chain | Select -Skip 1 | %{
			$_.FileKey | %{
				$_
			}
		}
	}
	$vm.ExtensionData.LayoutEx.File | where{$fileList -contains $_.Key} | %{
		$snapSize += $_.Size
	}
	$snapSize
} -Force -BasedOnExtensionProperty 'LayoutEx'



New-VIProperty -Name ToolsVersion -ObjectType VirtualMachine `
-ValueFromExtensionProperty ‘config.tools.ToolsVersion’ `
-Force


New-VIProperty -Name ToolsVersion -ObjectType VirtualMachine `
	-ValueFromExtensionProperty ‘config.tools.ToolsVersion’ `
	-Force



New-VIProperty -Name ToolsVersionStatus -ObjectType VirtualMachine -Value {
param($vm)
$vm.ExtensionData.Guest.ToolsVersionStatus
} -Force



New-VIProperty -Name ToolsVersionStatus -ObjectType VirtualMachine -Value {
	param($vm)
	$vm.ExtensionData.Guest.ToolsVersionStatus
} -Force



New-VIProperty -Name vCenterServer -ObjectType VirtualMachine `
-Value {$Args[0].Uid.Split(“:”)[0].Split(“@”)[1]} -Force



New-VIProperty -Name vCenterServer -ObjectType VirtualMachine `
	-Value {$Args[0].Uid.Split(“:”)[0].Split(“@”)[1]} -Force



New-VIProperty -Name VMCluster -ObjectType VirtualMachine `
-Value {param($vm)($vm|Get-Cluster).Name} -Force



New-VIProperty -Name VMCluster -ObjectType VirtualMachine `
  -Value {param($vm)($vm|Get-Cluster).Name} -Force


New-VIProperty -Name VMIenabled -ObjectType VirtualMachine `
-Value {
param($vm)
($vm.Extensiondata.Config.Hardware.Device | where {$_.GetType().Name -eq "VirtualMachineVMIROM"}) -ne $null
} -BasedOnExtensionProperty "Config.Hardware.Device" `
-Force


New-VIProperty -Name VMIenabled -ObjectType VirtualMachine `
	-Value {
		param($vm)
 
		($vm.Extensiondata.Config.Hardware.Device | where {$_.GetType().Name -eq "VirtualMachineVMIROM"}) -ne $null
	} -BasedOnExtensionProperty "Config.Hardware.Device" `
	-Force
#VmxDatastoreFullPath

New-VIProperty -Name VmxDatastoreFullPath `
-ObjectType VirtualMachine `
-ValueFromExtensionProperty Config.Files.VmPathName `
-Force


New-VIProperty -Name VmxDatastoreFullPath `
	-ObjectType VirtualMachine `
	-ValueFromExtensionProperty Config.Files.VmPathName `
	-Force


New-VIProperty -Name WebShortcut -ObjectType VirtualMachine `
-Value {
param($vm)
$vCenterServer = $vm.Uid.Split(“:”)[0].Split(“@”)[1]
if($vm.ExtensionData.Client.ServiceContent.About.ApiVersion.Split('.')[0] -ge 5){
$Uuid = $vm.ExtensionData.Client.ServiceContent.About.InstanceUuid
$Id = $vm.Id.Replace("e-v","e:v")
"https://${vCenterServer}:9443/vsphere-client/vmrc/vmrc.jsp?vm=${Uuid}:${id}"
}
else{
$Id = $vm.Id.Replace("e-v","e|v")
“https://$vCenterServer/ui/?wsUrl=https://localhost:80/sdk&mo=${Id}&{inventory}=none&tabs=hide_”
}
} -Force | Out-Null


New-VIProperty -Name WebShortcut -ObjectType VirtualMachine `
	-Value {
		param($vm)
 
		$vCenterServer = $vm.Uid.Split(“:”)[0].Split(“@”)[1]
		if($vm.ExtensionData.Client.ServiceContent.About.ApiVersion.Split('.')[0] -ge 5){
			$Uuid = $vm.ExtensionData.Client.ServiceContent.About.InstanceUuid
			$Id = $vm.Id.Replace("e-v","e:v")
			"https://${vCenterServer}:9443/vsphere-client/vmrc/vmrc.jsp?vm=${Uuid}:${id}"
		}
		else{
			$Id = $vm.Id.Replace("e-v","e|v")
			“https://$vCenterServer/ui/?wsUrl=https://localhost:80/sdk&mo=${Id}&{inventory}=none&tabs=hide_”
		}
	} -Force | Out-Null



New-VIProperty -Name 'YellowFolderName' -ObjectType 'VirtualMachine' -Value {
param($vm)
$entity = Get-View $vm.ExtensionData.ResourcePool
while($entity.GetType().Name -ne 'Folder'){
$entity = Get-View $entity.Parent
}
$entity.Name
} -Force -BasedOnExtensionProperty 'ResourcePool'


New-VIProperty -Name 'YellowFolderName' -ObjectType 'VirtualMachine' -Value {
	param($vm)
 
	$entity = Get-View $vm.ExtensionData.ResourcePool
	while($entity.GetType().Name -ne 'Folder'){
		$entity = Get-View $entity.Parent
	}
	$entity.Name
} -Force -BasedOnExtensionProperty 'ResourcePool'



New-VIProperty -Name 'YellowFolderName' -ObjectType 'VirtualMachine' -Value {
param($vm)
function Get-FirstFolder{
param($entityMoRef)
$entity = Get-View $entityMoRef
while($entity.GetType().Name -ne 'Folder'){
$entity = Get-FirstFolder $entity.Parent
}
$entity
}
(Get-FirstFolder $vm.ExtensionData.ResourcePool).Name
} -Force -BasedOnExtensionProperty 'ResourcePool'


New-VIProperty -Name 'YellowFolderName' -ObjectType 'VirtualMachine' -Value {
	param($vm)
 
	function Get-FirstFolder{
		param($entityMoRef)
 
		$entity = Get-View $entityMoRef
		while($entity.GetType().Name -ne 'Folder'){
			$entity = Get-FirstFolder $entity.Parent
		}
		$entity
	}
 
	(Get-FirstFolder $vm.ExtensionData.ResourcePool).Name
} -Force -BasedOnExtensionProperty 'ResourcePool'

#VMHost

New-VIProperty -ObjectType VMHost -name AvgCPUUsage24Hr `
-Value {
“{0:f2}” -f ($Args[0] | `
Get-Stat -stat cpu.usage.average | `
where { $_.Instance -eq “” } | `
Measure-Object -Property Value -Average).Average
} `
-Force

New-VIProperty -ObjectType VMHost -name AvgCPUUsage24Hr `
	-Value {
		“{0:f2}” -f ($Args[0] | `
			Get-Stat -stat cpu.usage.average | `
			where { $_.Instance -eq “” } | `
			Measure-Object -Property Value -Average).Average
	} `
	-Force


#ClusterName


New-VIProperty -Name ClusterName -ObjectType VMHost `
-Value {
param($vmhost)
$vmhost.Parent.Name
} `
-Force

New-VIProperty -Name ClusterName -ObjectType VMHost `
	-Value {
		param($vmhost)
		$vmhost.Parent.Name
	} `
	-Force

#Hardware
New-VIProperty -Name 'Hardware' -ObjectType 'VMHost' `
-ValueFromExtensionProperty 'Hardware'

New-VIProperty -Name 'Hardware' -ObjectType 'VMHost' `
	-ValueFromExtensionProperty 'Hardware'

#MemoryTotalGB


New-VIProperty -Name MemoryTotalGB -ObjectType VMHost `
-Value {
param($vmhost)
[Math]::Round($vmhost.MemoryTotalMB/1KB,1)
} `
-Force


New-VIProperty -Name MemoryTotalGB -ObjectType VMHost `
	-Value {
		param($vmhost)
		[Math]::Round($vmhost.MemoryTotalMB/1KB,1)
	} `
	-Force

#Number of powered on guests
New-VIProperty -ObjectType VMHost -name NumberOfPoweredOnVMs -Value {
($Args[0] | Get-VM | ?{$_.PowerState -eq “PoweredOn”} | Measure-Object).Count
} -Force


New-VIProperty -ObjectType VMHost -name NumberOfPoweredOnVMs -Value {
    ($Args[0] | Get-VM | ?{$_.PowerState -eq “PoweredOn”} | Measure-Object).Count
} -Force


#NumberOfVMs
New-VIProperty -ObjectType VMHost -name NumberOfVMs `
-Value {($Args[0] | Get-VM | Measure-Object).Count } `
-Force


New-VIProperty -ObjectType VMHost -name NumberOfVMs `
	-Value {($Args[0] | Get-VM | Measure-Object).Count } `
	-Force


#NumPoweredOnvCPUs
New-VIProperty -ObjectType VMHost -name NumPoweredOnvCPUs `
-Value {
$TotalvCPU = 0
$Args[0] | Get-VM | where { $_.PowerState -eq "PoweredOn" } | foreach {
$TotalvCPU += $_.NumCPU
}
$TotalvCPU
} -Force


New-VIProperty -ObjectType VMHost -name NumPoweredOnvCPUs `
 -Value {
   $TotalvCPU = 0
   $Args[0] | Get-VM | where { $_.PowerState -eq "PoweredOn" } | foreach {
    $TotalvCPU += $_.NumCPU
   }
   $TotalvCPU
 } -Force

#NumvCPUs


New-VIProperty -ObjectType VMHost -name NumvCPUs `
-Value {
$TotalvCPU = 0
$Args[0] | Get-VM | foreach {
$TotalvCPU += $_.NumCPU
}
$TotalvCPU
} -Force


New-VIProperty -ObjectType VMHost -name NumvCPUs `
 -Value {
   $TotalvCPU = 0
   $Args[0] | Get-VM | foreach {
    $TotalvCPU += $_.NumCPU
   }
   $TotalvCPU
 } -Force


#Credit: Alan Renouf

 


Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

When autocomplete results are available use up and down arrows to review and enter to go to the desired page. Touch device users, explore by touch or with swipe gestures.

Recent Posts

  • vROps: Management Pack Troubleshooting
  • Windows AD {Active Directory} (PowerShell) samples
  • Migrate VMs Between vCentres Using Powershell or PowerCLI
  • Set VM Tools to Update Automatically on VM Reboot using powershell
  • Windows Administrator Must Have Powershell Commands

Recent Comments

  • JB on Script: How to get VM with Tag Assignment and export results to csv using PowerCLI or Powershell
  • DL on How to change VCSA root password and bypass BAD PASSWORD: it is based on a dictionary word for vCenter VCSA root account warning
  • 360coolp on How to change VCSA root password and bypass BAD PASSWORD: it is based on a dictionary word for vCenter VCSA root account warning
  • Yogesh on ESXi 8.x, 7.x, 6.x Service sfcbd-watchdog Not Running / Fails to Start – VirtuallyThatGuy
  • VirtuallyThatGuy on ESXi 8.x, 7.x, 6.x Service sfcbd-watchdog Not Running / Fails to Start – VirtuallyThatGuy

Archives

  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019
  • May 2019
  • April 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • July 2018
  • June 2018
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • December 2017

Categories

  • Automation
  • PowerCLI
  • VMware
  • Windows
© 2025 VirtuallyThatGuy | Powered by Superbs Personal Blog theme