Matt's script is does not modify the numCPUs value. This should also be done:
$spec = New-Object -Type VMware.Vim.VirtualMachineConfigSpec -Property @{"NumCoresPerSocket" = 3}
should be:
$spec = New-Object -Type VMware.Vim.VirtualMachineConfigSpec -Property @{"NumCoresPerSocket" = 3;"numCPUs" = 3}