Get-View for VMS in subfolders

Hello community

I need the list of all the virtual machines in a specific folder, including subfolders.

In fact, I use the following script

$vms = Get-Folder "VDI" | Get-VM | Where-Object {$_.PowerState -eq "PoweredOff"}

foreach($line in ($vms | Get-Random -Count 20) ) { 
    if($line.PowerState -eq "PoweredOff") {
        $line | Start-VM -RunAsync | Out-Null
    }
}

The script runs periodically, and it will take more than 30 seconds to over 2000 virtual machines I want to speed up with Get - view. I've already tried it, but unfortunately it does not list the virtual machines of the subfolders.

Someone at - it an idea how to solve this problem?

You can try like this

$folderName = "VDI".

$folder = get-View - ViewType property file-name - filter @{'Name' = $folderName} | Select MoRef - ExpandProperty

Notice-EEG - ViewType VirtualMachine - SearchRoot $folder |

Select name

Tags: VMware

Similar Questions

  • Is there a PowerPoint Viewer for iPad 2 Air and where I get it?

    Is there a PowerPoint Viewer for the air of the ipad 2? If Yes, where can I get it?

    Yes, there are many in the app store of your choice. Here are the two. -AJ

    Microsoft has an application:

    Microsoft PowerPoint Microsoft Corporation

    https://appsto.Re/us/-ji9I.i

    Apple also has an application:

    Apple Keynote

    https://appsto.Re/us/ODmIv.i

  • Using Get - view instead of Get - VM for BusSharingMode from a virtual computer

    Yet again, another issue was with Get - view. I searched a lot of documentation, but still I don't get the logic how to find good properties that I need to use.

    In this case, I need to transfer this one:

    Get - VM | Get-SCSI controller. Where-Object {$_.} BusSharingMode - eq ˜Physical"} | Select {$_.} Parent.Name}, BusSharingMode

    in:

    Notice-EEG - ViewType VirtualMachine-Property Name,Config.NameofthePropertyforBusSharingMode

    I will be grateful if someone could provide a documentation (or at least give me an idea what to read to get oriented) on these properties and their format so that they can be used to Get-View.

    The closest thing I found is this one: http://pubs.vmware.com/vi3/sdk/ReferenceGuide/vim.VirtualMachine.html and the VirtualMachineConfigInfo: http://pubs.vmware.com/vi3/sdk/ReferenceGuide/vim.vm.ConfigInfo.htmlhttp://pubs.vmware.com/vi3/sdk/ReferenceGuide/vim.vm.ConfigInfo.html
    I guess that in this case, we are talking about VirtualHardware (SCSI controller): http://pubs.vmware.com/vi3/sdk/ReferenceGuide/vim.vm.VirtualHardware.html and still I cannot establish the connection.

    It is all documented in the VMware vSphere QAnywhere, but as the title suggests, this is a reference.

    The vSphere Web Services SDK Programming Guide is intendedas a learning guide.

    Only no VMware book that explains a bit more on the vSphere API and objects is the book of Steve Jin, called VMware VI and vSphere SDK: management of VMware Infrastructure and vSphere

    It is written for Java developers, but it explains the basic concepts.

    In this specific question, you must know that all devices connected to a virtual computer is located in Config.Hardware.Device.

    It is a loop through the devices and extract the virtual SCSI controllers, also with bus physics active sharing.

    Once you have, it's simple extract properties.

    foreach ($vm in Get-View - ViewType VirtualMachine - Name property, Config.Hardware.Device) {}

    $scsi = $vm. Config.Hardware.Device | where {$_-is [VMware.Vim.VirtualSCSIController] - and $_.} SharedBus - eq "physicalSharing"}

    {if ($SCSI)}

    $scsi | Select @{N = "VM"; E = {$vm. Name}},

    @{N = "Controller"; E={$_. DeviceInfo.Label}},

    @{N = "BusSharingMode"; E={$_. SharedBus}}

    }

    }

  • The use of Get - view instead of Get - VM for the advanced settings of a virtual computer

    I have a question in relation to the advanced settings of a virtual machine and using Get - view instead of Get - VM for this particular case:

    Get - VM * | Get-AdvancedSetting - name "scsi * sharing | Select the entity, Name, Value

    My idea is to use:

    Notice-EEG - ViewType VirtualMachine. Where {-not $_.} Config.Template} | Where {$_.} {Advanced.Setting - eq ' scsi * sharing "} | Select the entity, Name, Value

    but as far as I can see there is nothing for the advanced configuration of 'VirtualMachine' here: https://pubs.vmware.com/vsphere-51/index.jsp?topic=%2Fcom.vmware.powercli.cmdletref.doc%2FVirtualMachine.htm

    I also took a quick glance at https://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/vim.vm.ConfigSpec.html , but I can't figure out how to use "extraConfig"in the script PowerCLI to extract this particular information for "Sharing of SCSI".»

    There is information how to use the API to add or change a computer virtual here .vmx file key advances: http://blogs.vmware.com/PowerCLI/2008/09/changing-vmx-fi.html but it is not clear to me how to use it just to extract information without changing what.

    Try like this

    foreach ($vm in (Get-View - ViewType VirtualMachine - property Name, Config.ExtraConfig - filter @{'Config.Template ' =' False'})) {}

    $vm. Config.ExtraConfig | where {$_.} Key - like "{scsi * sharing '} |"

    Select @{N = "VM"; E = {$vm. Name}},@{N='Template'; E = {$vm. Config.Template}}, Key, Value

    }

  • Get-view do not show anything for some servers

    One of my colleagues has created a script to extract some VM PCI slot numbers the script seems simple like this and work for (most) servers.

    $ServerName = "Test01".

    $vmview = (get-View - ViewType VirtualMachine-filter @{"Name" = $ServerName}).config.hardware

    $AllSasControllers = $vmview. Device | Where {$_.} DeviceInfo.Summary - eq 'SAS LSI Logic'}

    foreach ($SasController to $AllSasControllers)

    {

    Write-Host "Pci slot number:" $SasController.SlotInfo.PciSlotNumber

    }

    It worked before, but since a few days on 3 virtual machines which are one of the 6 we want to check returns no results more. All 3 VM is connected to the same vCenter, while others are connected to another. Knowing this, we'll try another VM in the vCenter (defective)... .strange return these results...

    On a defective VM, I note that:

    $AllSasControllers is filled with the results

    But the slotinfo property is empty, so far I can only see this behavior on 3 virtual machines that worked fine before.

    We did a few add/remove disk shares a few weeks on all VM 6 on the two vCenters. (may be a clue)

    One has obtained clues where to look?

    After a restart of vCenter problem seems to have disappeared, requires that certain inconsistencies of data or something.

  • Regular Get-view filter expressions

    I have the following code:

    $vms = get-VM-location 'test '.

    for ($i = 0; $i - lt $vms. County; $i++)

    {

    $vmOS = get-View - ViewType 'VirtualMachine' - filter @{"Name" = $vms [$i] .name} - property @("Nom", "Config.GuestFullName") | Select-Object - property name, @{N = "ConfiguredOS"; E={$_. Config.GuestFullName}}

    $vmOS

    }

    $vms contains some virtual machines to a folder called 'test '. I have 2 virtual machines in the folder - 'test' and 'test2 '. When I run the code above, when the 'test' VM is put in the loop, she returned twice. Time for 'test', and 'test2 '. I'm looking for a regular expression that I can use to get the exact name of each virtual computer so that only 1 value is returned by $vmOS in each loop.

    The filter is a regular expression, you can use the indicators of positions (^ and $).

    Something like that

    $vms = get-VM-location 'test '.

    for ($i = 0; $i - lt $vms. County; $i++)

    {

    $vmOS = get-View - ViewType 'VirtualMachine' - filter @{"Name" = "^ $($vms[$i].name)$" ""}-property @("Nom","Config.GuestFullName") |

    Select-Object - property name, @{N = "ConfiguredOS"; E={$_. Config.GuestFullName}}

    $vmOS

    }

  • Get - VM to Get-View - viewtype VirtualMachine

    We want to replace our Get-VM with Get-View-viewtype VirtualMachine function, because it is a faster method.

    But for some reason, the output is not the same.

    You expect that they return both the same VirtualMachine object.

    Out with Get - VM:

    Name, PowerState, NUM CPUs, MemoryGB

    Out with Get-View - viewtype VirtualMachine:

    Capacity, Config, layout, LAyoutEx, storage,... all the VMware.Vim.VirtualMachine object.

    Our methods:

    $Hosts = get-VMsByLocation-site $Location

    $VMs = @)

    $Hosts | {ForEach}

    (A) $VMs += Get - VM $_

    (B) $VMs += Get-view -ViewType VirtualMachine - filter @{'Name' = $_}

    }

    https://www.VMware.com/support/developer/windowstoolkit/wintk40u1/HTML/get-VM.html

    https://communities.VMware.com/thread/474763

    https://www.VMware.com/support/developer/converter-SDK/conv50_apireference/Vim.virtualmachine.html

    https://pubs.VMware.com/vSphere-51/index.jsp#com.VMware.PowerCLI.cmdletref.doc/virtualmachine.html

    Hello, tendonsie-

    Yes, you are right: If you change the type of object that you are using, and then later call what's going used probably not work with .

    However, another part of the power of Get - view: you have direct access to a representation of the object "full" vSphere - the View .NET VirtualMachine object, in this case.  So, you do no need another call to get the CpuReservationMhz - you can get it directly from the object VirtualMachine who have already recovered you.  An example of include these goods in the output (based on the example I gave first):

    Get-View -ViewType VirtualMachine -Property Name,Runtime.PowerState,Config.Hardware,Config.CpuAllocation.Reservation | Select-Object Name,    @{n="PowerState"; e={$_.Runtime.PowerState}},    @{n="NumCPU"; e={$_.Config.Hardware.NumCPU}},    @{n="MemoryGB"; e={$_.Config.Hardware.MemoryMB / 1KB}},    @{n="CpuReservationMhz"; e={$_.Config.CpuAllocation.Reservation}}
    

    You see the additional calculated property, CpuReservationMhz, here.  Now you don't need even have call the Get-VMResourceConfiguration cmdlet.

    Thus, work comes to discover what are the properties of the View .NET object that you have recovered.  And this work is supported by the vSphere API documentation, a link that is available to VMware vSphere Web Services SDK Documentation.  How is that?

  • Can be combined in the same script Get - VM and Get - view?

    Hello

    I am trying to find a way to combine these two Get - VM and Get - view in the same script.

    Script # 1

    Get-Cluster Management | Get - VM | Select Name,@{Name="HardwareVersion; Expression = {$_.} ExtensionData.Config.Version}}

    Script # 2

    Get-Cluster Management | Get - vm | where {$_.powerstate - don't "PoweredOff"} | % {get-view $_.id} | Select Name, @{Name = "ToolsVersion"; {Expression = {$_.config.tools.toolsVersion}}, @{Name = "ToolStatus"; Expression = {$_.} Guest.ToolsVersionStatus}}

    I've always had problems try this out and now, I need to combine them into a single script in figure.

    If you can help me or point me in the right direction would be great.

    Thank you

    Mike

    Curiosity got the best of me so I came with this. You had more correct, but you need to make a custom object so that the properties you are looking for can all be used simultaneously.

    It does not use the pipeline and uses a foreach loop.

    ----------------------------------------------------------------------------------------------

    $vms = get-Cluster Management | Get - VM? {$_.powerstate - don't "PoweredOff"}

    {foreach ($vm to $vms)

    $VMID = get-View ($vm.id)

    New-object psobject-property @ {}

    VM = $vm

    HardwareVersion = $vm. ExtensionData.Config.Version

    ToolsVersion = $VMID.config.tools.toolsVersion

    ToolsStatus = $VMID. Guest.ToolsVersionStatus

    } | Select the virtual machine, ToolsVersion, HardwareVersion, ToolsStatus

    }

    ----------------------------------------------------------------------------------------------

    Or use this option if you like the pipeline with Foreach-Object approach.

    ----------------------------------------------------------------------------------------------

    Get-Cluster Management | Get - VM? {$_.powerstate - don't "PoweredOff"} | % {

    $VMID = get-View ($_.id)

    New-object psobject-property @ {}

    VM = $_

    HardwareVersion = $_. ExtensionData.Config.Version

    ToolsVersion = $VMID.config.tools.toolsVersion

    ToolsStatus = $VMID. Guest.ToolsVersionStatus

    } | Select the virtual machine, ToolsVersion, HardwareVersion, ToolsStatus

    }

    ----------------------------------------------------------------------------------------------

    Both methods are correct that I can see. I tried both and both work well. You can easily piple only out to Export-Csv at the end of the select line. I hope this helps.

    Andrew

    Post edited by: andrewsardinha
    condition of powerstate added to each block operator and foreach-object script to the last script block.

  • Script to set the CPU and memory for VMS

    Hi all

    We have an environment with 100's of virtual machines. We have classified these VMs, and each category will have specific vMem and vCPU. Excel / csv spreadsheet has the list of virtual machines, as well as the values of vCPU and vMem. I'm looking for a script that can set the values of vCPU and vMem for virtual machines according to the directives of the excel sheet. If anyone can help with this?

    Thank you very much

    Try this.  I took the function of hotadd from here:

    http://ICT-freak.nl/2009/10/05/PowerCLI-EnableDisable-the-VM-hot-add-features/

    I tested against 1 VM and it works well.  It will make a loop and power all VM power off in parallel, then it will change all.  Then turn on all at the same time.  If you do not parallel you can change it.

    I would like to test in your lab or against 1-2 not prod the first VM.

    Same CSV colum

    VMNAME, MEM, CPU

    Function Enable-MemHotAdd($vm){    $vmview = Get-vm $vm | Get-View     $vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
    
        $extra = New-Object VMware.Vim.optionvalue    $extra.Key="mem.hotadd"    $extra.Value="true"    $vmConfigSpec.extraconfig += $extra
    
        $vmview.ReconfigVM($vmConfigSpec)}
    
    Function Enable-vCpuHotAdd($vm){    $vmview = Get-vm $vm | Get-View     $vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
    
        $extra = New-Object VMware.Vim.optionvalue    $extra.Key="vcpu.hotadd"    $extra.Value="true"    $vmConfigSpec.extraconfig += $extra
    
        $vmview.ReconfigVM($vmConfigSpec)}
    
    $vmlist = Import-CSV C:\csvfile.csv
    
    foreach ($item in $vmlist) {    $vmname = $item.vmname    Stop-VM -VM $vmname -RunAsync     }foreach ($item in $vmlist) {
    
        $vmname = $item.vmname    $cpu = $item.cpu    $mem = [int]$item.mem * 1024    Enable-MemHotAdd $vmname    Enable-vCpuHotAdd $vmname    Set-VM -VM $vmname -NumCpu $cpu -MemoryMB $mem -RunAsync -Confirm:$false
    
    }
    
    foreach ($item in $vmlist) {    $vmname = $item.vmname    Start-VM -VM $vmname -RunAsync     }
    
  • Get-View and - filter

    I'm a (relatively) new convert to get - view the incredible increase in speed to run scripts PowerCLI through ESXi hosts hundreds / thousands of virtual machines.

    I've been struggling with how to do it with a list of the MV?  What I want to do, it's with a provided list of VMs get the hardware version and version of the tools.

    Normally, if you wanted a report of everything that you would do the following:

    Notice-EEG - viewtype VirtualMachine-property name, Config. Select Name, @{N = "HWVersion"; E={$_. Config.Version}},@{N="Tools '; E={$_. Config.Tools.ToolsVersion}} | FT-auto

    Now read on - filter is seems the way to go-, but it uses a hash table.  That is to say "Name" = "Foo".  It does not seem to manage 'Name' = $vmList where $vmList is a collection of multiple virtual machines.  I will not go into how if the variable is a unique virtual machine that Foo matches Foo and FooBar.

    What I have used is the following:

    $vmList = get-content c:\scripts\import\listofvms.txt

    Get - vm $vmList | Opinion-GET-property name, Config. Select Name, @{N = "HWVersion"; E={$_. Config.Version}},@{N="Tools '; E=$_. Config.Tools.ToolsVersion}} | FT-auto

    The only problem is that I feel like this is a workaround solution - it should all be achievable using get - view directly.  -If I wanted to use - filter, with a collection of virtual machines would how I did this?

    See you soon

    Robert

    Hi Robert,.

    If you use the cmdlet Get-view and search two VM called foo and bar, you will need to make a filter with a regular expression. You must use the vertical bar as a sign "or" in the regular expression. For example

    Notice-EEG - ViewType VirtualMachine-Property Name, filter-Config @{"Name"=' foo | "} bar'}

    You can use the .NET Join method string to construct the regular expression from the $vmList variable. Like this:

    $vmList = get-content c:\scripts\import\listofvms.txt
    Get-View -ViewType VirtualMachine -Property Name,Config -Filter @{"Name"="$([string]::Join('|',$vmList))"} | `
    Select-Object -Property Name,@{N="HWVersion";E={$_.Config.Version}},@{N="Tools";E={$_.Config.Tools.ToolsVersion}} | `
    Format-Table -AutoSize
    

    Best regards, Robert

    Post edited by: RvdNieuwendijk has added the explanation at the beginning of the post.

  • Help with Get - view in a subset of clusters

    I'm getting to do a get-view command that limit the selection based on a subset of the clusters. I can easily do for objects of the VM, but when I use the same order type of the display does not work. Can anyone suggest a way to work for it. Here's the code that can better describe what I do:

    ------# Get VMs in the subset of the clusters * it works

    $Subset = 'Group 2', ' group 4 ", «group 6"»

    $VM = get-Cluster $Subset | Get - VM | Name sort

    ------# Get VM in the subset of the clusters * it does not work

    $Subset = 'Group 2', ' group 4 ", «group 6"»

    $VMView = get-Cluster $Subset | Notice-EEG - ViewType VirtualMachine

    Thanks in advance,

    -Earl

    Hi Earl,

    The problem is that the cmdlet Get-View is not the - rental setting that is implicit, used by the Get - VM cmdlet in the pipeline to filter on clusters. You can change your code in the following way to get all views of the virtual machine to the specified cluster:

    $Subset = "Cluster2","Cluster 4","Cluster 6"
    $VMView = Get-Cluster $Subset | Get-VM | Get-View
    

    Best regards, Robert

  • Question about Get-View

    Note:

    I use () instead of media because this page don't like the media.

    Hello

    For some reason when I use the following code:

    Get - VM | Get-View | % {

    $_. CustomFields ("Barcode")

    I get a cannot index into a table null error.

    But... If I use this code:

    $Vms = get - VM

    {foreach ($vm to $vms)

    $Vm.CustomFields ("Barcode")

    }

    It takes more time, but it works without error.

    Does anyone know why this is? Is there a known issue with the cmdlet Get-view?

    Thank you

    Looking to 2 things different here.

    The Get - Vm cmdlet returns a VirtualMachineImpl object that contains the CustomFields property.

    Get - VM | Get-views as you watch a VirtualMachine object that has a property customValue (but no CustomFields property).

  • Get-view SearchRoot when duplicate. MoRef exists

    I created a script to list the details of the bunch and I thought I would faster by using get - view instead of the Get command for each object.  I came across a problem on line 14.  It seems that I have data centers in different virtual centers with the same. MoRef values.  Not sure how I can script around that.

    Note that this script below is a global script version

    $csvreport = @()
    $ClusterList=@()
    $OutputFile="C:\Temp\looptesting.csv"
    $Date=Get-Date -Format d
    
    
    
    
      foreach ($virtualcenter in $DefaultVIServers) {
    
    
      ForEach ($DC in (Get-View -ViewType  Datacenter -Server $virtualcenter)){
    
      Foreach ($cluster in (Get-View -ViewType ClusterComputeResource -SearchRoot $DC.MoRef)){
    
      $ClusterList = "" |select-object "Collection Date","Virtual Center",DataCenter,Cluster
    
      $ClusterList."Collection Date"=$Date
      $ClusterList."Virtual Center"=$virtualcenter
      $ClusterList.DataCenter=$DC.Name
      $ClusterList.Cluster=$cluster.Name
    
      $csvreport += $ClusterList 
      }
      }
      }
    
    
    
    
    $csvreport |export-csv -NoTypeinformation $OutputFile
    

    Can't you just use the Server parameter on line 14, as you did on line 12?

  • Get - view ClusterComputeResource vs StoragePod

    The following example of a loop in the cluster/host/vm to PowerCLI LinkedView - a Simple example, I found. The beautiful Hippo

    $VMArray = @)

    $ClusterArray = get-view ViewType - ClusterComputeResource

    $ClusterArray | % {

    $_. UpdateViewData ("$host.name", "Host.VM.Name")

    $ClusterName = $_. Name

    $_. LinkedView.Host | % {

    $HostName = $_. Name

    $_. LinkedView.VM | % {

    $VMName = $_. Name

    $VMArray += new-Object - TypeName PSObject - Prop)

    @{'Clusters' = $ClusterName;

    "Home" = $HostName;

    'Name' = $VMName

    }

    )

    }

    }

    }

    I tried the equivalent code for the storage of cluster/datastore/vm

    $DSVMArray = @)

    $DSClusterArray = get-view ViewType - StoragePod

    $DSClusterArray | % {

    $_. UpdateViewData ("ChildEntity.Name", "ChildEntity.VM.Name")

    $DSClusterName = $_. Name

    $_. LinkedView.ChildEntity | % {

    $DSName = $_. Name

    $_. LinkedView.VM | % {

    $VMName = $_. Name

    $DSVMArray += new-Object - TypeName PSObject-Prop)

    @{'DSCluster' = $DSClusterName;

    'Datastore' = $DSName;

    "VM" = $VMName;

    }

    )

    }

    }

    }

    But this error

    Exception by calling 'UpdateViewData' with '2' or the arguments: "the path specified."

    is not correct. Item "vM" does not exist. »

    Online: 4 char: 5

    +     $_. UpdateViewData ("ChildEntity.Name", "ChildEntity.VM.Name")

    +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo: NotSpecified: (:)) [], MethodInvocationException)

    + FullyQualifiedErrorId: ArgumentException

    The data structures are the same for me.  Could someone please explain the error?

    Cannot use UpdateViewData if properties can be null.  In my case I have warehouses of data with no VM so I can not UpdateViewData ("ChildEntity.VM.Name").

    $DSVMArray = @)

    $DSClusterArray = get-view ViewType - StoragePod

    $DSClusterArray | % {

    $DSCluster = $_

    $DSCluster.UpdateViewData ("ChildEntity.Name")

    $DSClusterName = $DSCluster.Name

    If ($DSCluster.LinkedView.ChildEntity.VM.Count - gt 0) {}

    $DSCluster.LinkedView.ChildEntity.UpdateViewData ("VM. Name")

    }

    $DSCluster.LinkedView.ChildEntity | %{

    $DSName = $_. Name

    $_. LinkedView.VM | %{

    $VMName = $_. Name

    $DSVMArray += new-Object - TypeName PSObject-Prop)

    @{'DSCluster' = $DSClusterName;

    'Datastore' = $DSName;

    "VM" = $VMName;

    }

    )

    }

    }

    }

  • Confused on how to get CpuTotalMHz for a VMHost (not a virtual machine)

    I'm new to PowerCLI and attempted several days a list of Clusters, associated with VMHosts in the cluster, with details on each VMHost, but I can't get all the details.  I'm looking for CPU info at VMHost level, not at the level of VMGuest.  the script it returns white instead of the data.

    Can someone point me in the right direction here?

    For example, when I run the script below, the last two fields (CpuTotalMhz and NumCpu) are empty!

    Cluster.Name and VMHost.Name are populated correctly.

    When I look at the Cmdlet PowerCLI reference (vSphere 5.5) for VMHost it shows a bunch of properties, but most of them seem inaccessible.

    No error message, just empty fields.

    $report = @)

    {foreach ($Cluster Get-cluster)
    Get-VMHost-location $cluster | %{
    $info = "" | Select the Cluster, VMhost, CpuTotalMhz, NumCpu
    $info. Cluster = $cluster. Name
    $info. VMHost = $_. Name
    $info. CpuTotalMhz = $_. CpuTotalMhz
    $info. NumCpu = $_. NumCpu
    $report += $info
    }
    }

    $report | Export-Csv "C:\tmp\vmware-reports\Cluster-Host.csv" - NoTypeInformation - UseCulture

    I tried to dig at the command line on the object generated by the Get - views, but can not find where VMHost information at the level of the CPU, RAM, etc. are available.

    [VI Toolkit] C:\tmp\vmware-reports > $VMHost = get-view - viewtype HostSystem-filter @{"Name"="esxhost.company.com"}

    [VI Toolkit] C:\tmp\vmware-reports > $VMHost

    Duration: VMware.Vim.HostRuntimeInfo
    Summary: VMware.Vim.HostListSummary
    Material: VMware.Vim.HostHardwareInfo
    Capacity: VMware.Vim.HostCapability
    ConfigManager: VMware.Vim.HostConfigManager
    Config: VMware.Vim.HostConfigInfo
    VM: {VMware.Vim.ManagedObjectReference, VMware.Vim.ManagedObjectReference, VMware.Vim.ManagedObjectRe
    Ference, VMware.Vim.ManagedObjectReference...}
    Data store: {VMware.Vim.ManagedObjectReference, VMware.Vim.ManagedObjectReference, VMware.Vim.ManagedObjectRe
    Ference, VMware.Vim.ManagedObjectReference...}
    Network: {VMware.Vim.ManagedObjectReference, VMware.Vim.ManagedObjectReference}
    DatastoreBrowser: VMware.Vim.ManagedObjectReference
    SystemResources: VMware.Vim.HostSystemResourceInfo
    Mother: VMware.Vim.ManagedObjectReference
    CustomValue: {}
    OverallStatus: Green
    ConfigStatus: Green
    ConfigIssue: {}
    EffectiveRole:-{2}
    Authorization: {}
    Name: esxhost.company.com
    DisabledMethod: {ExitMaintenanceMode_Task, PowerUpHostFromStandBy_Task, ReconnectHost_Task}
    RecentTask: {}
    DeclaredAlarmState: {738 - 1.host - alarm, alarm - 12.host - 738, 738 - 13.host - alarm, alarm - 14.host - 738...}
    TriggeredAlarmState: {}
    Value: {}
    AvailableField: bad memory {Module}
    MoRef: VMware.Vim.ManagedObjectReference
    Client: VMware.Vim.VimClient

    [VI Toolkit] C:\tmp\vmware-reports > $VMHost.HArdware


    SystemInfo: VMware.Vim.HostSystemInfo
    CpuInfo: VMware.Vim.HostCpuInfo
    CpuPkg: {0 1 2 3 4 5 6 7}
    MemorySize: 51537383424
    NumaInfo: VMware.Vim.HostNumaInfo
    PciDevice: {12:00.1, 00:1d.0, 12:00.0, 00:1d.1...}
    CpuFeature: {VMware.Vim.HostCpuIdInfo, VMware.Vim.HostCpuIdInfo, VMware.Vim.HostCpuIdInfo, VMware.Vim.HostCpuIdIn
    FO...}
    BiosInfo: VMware.Vim.HostBIOSInfo
    DynamicType:
    DynamicProperty:

    [VI Toolkit] C:\tmp\vmware-reports > $VMHost.Hardware.CpuFeature


    Level: 0
    Seller:
    EAX: 0000:0000:0000:0000:0000:0000:0000:1010
    EBX: 0111:0101:0110:1110:0110:0101:0100:0111
    ECX: 0110:1100:0110:0101:0111:0100:0110:1110
    EDX: 0100:1001:0110:0101:0110:1110:0110:1001
    DynamicType:
    DynamicProperty:

    Level: 1
    Seller:
    EAX: 0000:0000:0000:0001:0000:0110:0111:0110
    EBX: 0000:0000:0000:0100:0000:1000:0000:0000
    ECX: 0000:0000:0000:1100:1110:0011:1011:1101
    EDX: 1011:1111:1110:1011:1111:1011:1111:1111
    DynamicType:
    DynamicProperty:

    Level:-2147483648
    Seller:
    EAX: 1000:0000:0000:0000:0000:0000:0000:1000
    EBX: 0000:0000:0000:0000:0000:0000:0000:0000
    ECX: 0000:0000:0000:0000:0000:0000:0000:0000
    EDX: 0000:0000:0000:0000:0000:0000:0000:0000
    DynamicType:
    DynamicProperty:

    Level:-2147483647
    Seller:
    EAX: 0000:0000:0000:0000:0000:0000:0000:0000
    EBX: 0000:0000:0000:0000:0000:0000:0000:0000
    ECX: 0000:0000:0000:0000:0000:0000:0000:0001
    EDX: 0010:0000:0000:0000:0000:1000:0000:0000
    DynamicType:
    DynamicProperty:

    Level :-2147483640
    Seller:
    EAX: 0000:0000:0000:0000:0011:0000:0010:0110
    EBX: 0000:0000:0000:0000:0000:0000:0000:0000
    ECX: 0000:0000:0000:0000:0000:0000:0000:0000
    EDX: 0000:0000:0000:0000:0000:0000:0000:0000
    DynamicType:
    DynamicProperty:

    Thank you

    -Joe

    Your script works for me (PowerCLI 5.5 and 6.0 R2 hosts)...

    I tried to dig at the command line on the object generated by the Get - views, but can not find where VMHost information at the level of the CPU, RAM, etc. are available.

    You were close, you can see $vmhost.hardware.Memorysize to the size in bytes. CPU info is $vmhost.hardware.CPUInfo, where you will find socket and core count, threads and speed in Hz

Maybe you are looking for

  • What happened in Aurora? He suddenly became Firefox Developer Edition on my computer. My favorite and addons all disappeared.

    I think that put Aurora on day before I turned off my computer. When I started again, Firefox Developer Edition appeared in place of the Aurora. My favorite and addons all disappeared.

  • There is no port found on open visa

    Hello experts LV. I'm not very good at programming, I had a working labview code and now it does not work. This code is to rotate a scene to motorize (material: instument of newmark) and measurement of light using photometer (material: Konica Minolta

  • location of Halo 4 leak

    Yes, I found the location of a Web site that is distributing versions of Halo 4 leaks. I'm trying to prevent that all sorts of people have already played and beat the game and I think it's unfair. and I know they get a way with it also. so in order f

  • T400 2764 CTO - is the 64 bit or 32 bit processor?

    Hello This question may be already answered probably but I wasn't able to find it, so my question is? I just bought T400 2764 CTO with Vista basic 32 bit OS. My question is about the material. I have P8400 processor, but I don't know if it's 32-bit o

  • [ERROR] Native package exception occurred

    When I'm wrapping my app webworks, both through the command line and gap I get this error: [ERROR] Native package exception has occurred How can I solve this problem?