Automation

 View Only
  • 1.  Custom attribute

    Posted 11 days ago

    Hi gurus

     I would like to get list of all vm and its  certain custom attribute values my $vm.CustomFields.values  does not bring any values

    can someone help please

    Thanks a bunch 



  • 2.  RE: Custom attribute

    Posted 11 days ago

    Can you share the code you tried?



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


    Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference


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



  • 3.  RE: Custom attribute

    Posted 11 days ago

    I did try the following but the name of the VM does not come up 

    get-vm | Get-Annotation  | Where { $_.Name -eq "attribute here" } | Select-Object -ExpandProperty Value,vm

    Thanks for jumping in 




  • 4.  RE: Custom attribute
    Best Answer

    Posted 11 days ago

    Try with

    Get-VM | Get-Annotation | where{$_.Name -eq 'attribute here'} | Select @{N='VM';E={$_.AnnotatedEntity.Name}},Value


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


    Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference


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