Retrieve the Name of the tag property

I'm definitely a novice PowerCLI. However, I have a script which is heavily borrowed from http://www.vstrong.info/2013/10/18/vmware-powercli-script-to-query-virtual-machine-events/

What I would like to make in addition to the values that are retrieved, also receive the Name property of the attribute of the tag.

The script I use now is:

$vcenterserver = "myvcenter".

# Check if VMware Snapin is loaded, otherwise, load

If ((Get - PSSnapin - name VMware.VimAutomation.Core - ErrorAction SilentlyContinue) - eq $null)

{

Add-PSSnapin VMware.VimAutomation.Core

}

SE connect-VIServer-Server $vcenterserver

$CDT = get-Date

Get-VM-name testvm | »

Get-VIEvent-Types of information - start $CDT. AddDays(-30)-finishing $CDT | »

Where {'}

$_. GetType(). Name - eq "VmBeingDeployedEvent" "

- or $_. GetType(). Name - eq "VmCreatedEvent" "

- or $_. GetType(). Name - eq "VmRegisteredEvent"} | »

Select the name of user, Createduserid, FullFormattedMessage, @{Name = "VM"; Expression = {$_.} Vm.Name}}, @{Name = "RC Code"; Expression = {$_.} Vm.Tag}}

He retrieves the correct values with the exception of the tag for the virtual machine. I also tried @{Name = "RC Code"; Expression = {$_.} Vm.Tag.Name}}

I can extract the value in a table using the following command, but can't seem to pull the Name property:

Get-VM-name testvm | Get-TagAssignment-category RCCode | Select-Object - ExpandProperty tag

Description of the categories of name

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

10031 technical RCCode except...

Any help would be appreciated, thanks!

OK, then try this. I have not yet tested, but it should do it for you:

Select the name of user, Createduserid, FullFormattedMessage, @{Name = "VM"; Expression = {$_.} Vm.Name}}, @{Name = "RC Code"; Expression = {$vm = ($_.)} UMM name); Get-TagAssignment | where {$_.} Entity-like ("$VM")}}} | Export Csv c:\Temp\csv.csv - NoTypeInformation - UseCulture

The issue was that as the expression of Code RC worked essentially a new request, the $_. UMM name was irrelevant for the entity. Instead I just had the previous $_. UMM name in a variable that is referenced in the cmdlet that followed. Let me know if it works for you.

Tags: VMware

Similar Questions

  • Retrieve the unique property of Pof object

    Is it possible to easily extract a single property of an object of POF?
    For example, suppose I have a person object that has an age, a name and a bunch of other properties.
    I want to find the names of all the people who are over 18, but want all the other properties of the person.

    I prefer not to get the entire object, and then iterate to the breast to extract the name for each of them and throwing the rest of the object. This seems to be an unnecessary overhead.

    I see that you can do this by using EntryProcessors and get the PofValue with the PofValueParser, but the data entry processors lock and unlock the cache entries, this felt like an unnecessary overhead for a read-only operation.

    I feel like there is almost a way, but do not see it.

    Someone at - it ideas

    Thank you
    Steve

    FWIW:

    You can use the extractors to drive the "select" as well as list the ' where clause ' in point 3.6. I was curious to know how the CohQL in 3.6 a tool does do that, and one of these Oracle here people posted the answer ('see the development plan' in the tool command line with the query to execute to display the details.) So, this is the approach I followed - that is what the plan of living room exits, just translated into API calls):

    For example:

    Select instrumentId, positionType positions where the bookId = and keys (game) = "TRADING".

    The equivalent API code:

    The "list of selection...". »
    Aggregator ReducerAggregator = new ReducerAggregator (new MultiExtractor ("getInstrumentId, getPositionType"));

    The ' where clause '...
    Filter filter = QueryHelper.createFilter ("" bookId = ' "+ bookId +" ' and the keys (game) = "TRADING" "");
              
    The final query...
    Map positionsMap = cache.aggregate (card) (filter, aggregator);

    There are questions stirring POF extractors to CohQL, so I avoided the and let it default using the ReflectionExtractors normal, even if my data in a distributed format POF cache, I found not the extractors of POF loss which would be huge a deal from a performance perspective, and I don't like the much simpler syntax of the CohQL. Look at the syntax 'point' to access the embedded child objects.

    Not sure if the above, that's what you're looking for, but it works for me.

    See you soon,.

    Steve

  • Can I hold ThisContext go a step and use it in a later step to find the name of the current stage? Error 1 when retrieving the name of the step.

    I am trying to create a generic message using LVOOP logging class.  The recorder would include information on stage during execution (name, sequence, etc.).  I would like to create the message object log and then move it into another object (communication, controller of oven, etc.).  Everyone should get its own copy.  None of this is a problem to date.

    I found ways to gather the necessary information to ThisContext.  However, this only seems to work if ThisContext is spent in running step.  If I want ThisContext in LVOOP, the next step to try to use causes an error 1 "an input parameter is incorrect."  Is it possible to get this kind of information (name, sequence, etc.) without ThisContext in at each stage?  It would be inappropriate to do so, but if necessary I will.  It does not go against LVOOP.

    Summary: Can I hold ThisContext go a step and use it in a later step to find the name of the current stage?  If not, is there an effective way to do this?

    My solution was to store the reference to thread.  At each step, I can retrieve the current context.  This is valid only in a thread, but meets my needs.  I could also move something to a higher level, but it would need to know the thread that interests me in any case.

  • Retrieves the name of the variable

    Hello

    I'm trying to change the OpenG changed? Subvi (see below) so that he will write the new value of the variable sent to 'Variant' if changed on the disk (using the following config VI). To do this, I need to somehow extract the variable name of the variable (any type) which was connected to the entrance of variant of the changed? Sub - VI by VI calling so that I can use it as a key name. Is this possible? This information is still transmitted to the Subvi?

    If you use openg, there is a "Get the name of data" function that retrieves the name of the data passed in the Variant.

  • My names Contact list for Windows Live "disappeared". My ISP says it still resides in my computer, but only Microsoft can allow retrieving the list. What must I do to get these names?

    My names Contact list for Windows Live "disappeared". My ISP says it still resides in my computer, but only Microsoft can allow retrieving the list. What must I do to get these names?

    Hello

    The question you have posted is related to Windows Live; This is why it would be better suited in the Windows Live community. Please visit the link below to find a community that will provide the best support.

    http://windowslivehelp.com/forums.aspx?ForumID=28aff142-9106-4d74-BE08-9b5d9fc0efea

  • Why is the "Called" property returns a name with *: Instance: 0?

    I'm building a VI that returns a list of all the side screws and their auxiliary screws, etc., a given top-level VI.  I first open a reference giving the path to the top-level VI, and then use the property 'Called' to get the subVIs. I then (in a loop) get all each Subvi conscripts by opening a reference using the name of the previous output called string. I noticed something when I ask for conscripts by the string name of XYZ.vi, that I get all its subvis, but I also have a XYZ.vi:Instance:0 name returned. What is the purpose of the proceeding: 0 and why is it happening? I like understand why Instance: x would never get added to the name, and also why VI would return his name in the property called? The VI is not defined as re-enterent or calling themselves dynamically or anything like that.

    Hope someone can explain that.

    Thank you

    James

    Hi ejb068,

    Hello and I hope that your well today.

    I continued to study your issue now I am back in the office, with my LabVIEW machine and resources OR. I concluded and also since found a confirmation of this issue.

    For a first level VI which has a few express screws on its block diagram, the names of the callee property currently includes a single instance of the upper level for each express VI VI.
    For example, if a VI has two ExpressVIs in the block diagram. The property called node will return two instances of the toplevel VI.

    First level VI = mainVI.vi

    Express VI = delay

    Result name called: mainVI:Instance0 (number lists according to the order screw Express are deleted from the diagram.)

    : first level VI name: InstanceX

    The problem is if you use VI server that this name is not valid - and causes a VI Server error. So I think it would be pretty safe filter these names.

    Please let me know what you think,

  • Artist names in the tags capping to 16 characters on Fuze MP3

    A minor fault on the "rocket" - I recently noticed that some of the files MP3 I have on my Fuze of the artist name display truncated versions, even if the tags to display OK on my computer. On the rocket, SOME but not all MP3 files have a maximum of 16 characters for the name of the artist concerned. Odd.

    I wonder if I can do something to label Fuze-compatible.

    Fuze displays artists on Vorbis files in shape and even to MP3 files, but most of the MP3s I've recently encoded with Foobar2000 poster cutting on my rocket.

    Examples:

    Band name Zacharias Carls group appears as 'Zacharias Carls'

    "Apoptygma Berzerk" becomes "Apoptygma Berzer"

    "Echo & the Bunnymen" becomes a fun 'Echo and the Bunny '.

    In some cases, this cut production of the artist in two, when some files display the full name while others only 16 first letters.

    Strange, minor, but ideas for a solution?

    certainly a coding problem.  I hit myself.   I think that the problem is the songs of the artist to 16 characters truncating is ID3v2.4, UTF-8.  If you search the forum, there are some other threads on this topic.

  • Retrieve the name of the model of the device

    Hello

    Is there a way to retrieve the name of the device in use? I wish I could know if the user is using a Z10, Q10 etc...

    Thank you

    Scott

    Have you tried with HardwareInfo?

    https://developer.BlackBerry.com/Cascades/reference/bb__device__hardwareinfo.html

  • Display the name of the tag as the column name and the value in the tag as a row of data from the input string.

    Hi Forum members,

    I am looking for a query display the name of the tag as the column name and the value in the tag as a row of data.

    I have to print the values within the tag to a file by choosing the value of the flags. the sequence of the tags will vary each time, as the tag name will change dynamically.

    So here is the example of input data and the expected output. The string in the text column must be separated as the column names and values.

    Input data
    Select 1 as seqno,' < > 0210A 50 4f < / 4f > < 5f20 > TEST CARD 16 < / 5f20 > < 5f2a > < / 5f2a > < 82 > 1 c 00 < / 82 > ' double text


    Output:

    Seqno 4f 5f20 5f2a 82
    0210A 50 16 1 00 TEST CARD 1

    Please help me by providing your entries on this.

    We use the version of Oracle 11.2.

    Note: This is not the XML string

    Thank you

    Shree

    with

    data in the form of

    (select 1 as seqno,'<4f>0210 A 50<5f20>TEST CARD 16<5F2a><82>00 1' text of all the double union)

    Select 2 as seqno,'XYZ<4F>0210 A 50<5f20>TEST CARD 16<5f2a><82>00 1' text of all the double union

    Select 3 as seqno,'<4f>0210 A 50<5f20>TEST CARD 16<5F2A><82>1 00XYZ ' text of all the double union

    Select option 4 as seqno,'<4F>0210 A 50<5F20>TEST CARD 16<5f2A><82>1 00XYZ' double text

    )

    Select d.seqno, x.*

    d the data,

    XMLTable ('/ root')

    by the way xmltransform (xmltype ('': replace (replace (text,'<><>'),)))

    XmlType (q'~http://www.w3.org/1999/XSL/Transform "version ="1.0"> ")

                                                     

                                                       

                                                         

                                                       

                                                     

                                                     

                                                       

                                                         

                                                       

                                                     

    ~'

    )

    )

    path of columns '4f' varchar2 (10) "tag4f."

    path of "5f20' varchar2 (30)"tag5f20. "

    path of '5f2a' varchar2 (10) "tag5f2a."

    path of varchar2 (10) "82" "tag82.

    ) x


    SEQNO 4f 5f20 5f2a 82
    1 0210A 50 16 TEST CARD - 1 00
    2 0210A 50 16 TEST CARD - 1 00
    3 0210A 50 16 TEST CARD - 1 00
    4 0210A 50 16 TEST CARD - 1 00

    with

    data in the form of

    (select 1 as seqno,'<4f>0210 A 50<5f20>TEST CARD 16<5F2a><82>00 1' text of all the double union)

    Select 2 as seqno,'XYZ<4F>0210 A 50<5f20>TEST CARD 16<5f2a><82>00 1' text of all the double union

    Select 3 as seqno,'<4f>0210 A 50<5f20>TEST CARD 16<5F2A><82>1 00XYZ ' text of all the double union

    Select option 4 as seqno,'<4F>0210 A 50<5F20>TEST CARD 16<5f2A><82>1 00XYZ' double text

    ),

    Chopper (seqno, Key, value, String) as

    (select seqno,

    regexp_substr (text,'<(.+?)>', 1, 1, null, 1),

    regexp_substr (Text,'>(.*?))

    regexp_substr (text,'<.+?>. *? ) (.*) $', 1, 1, null, 1). » <>'

    from the data

    Union of all the

    Select seqno,

    regexp_substr (String,'<(.+?)>', 1, 1, null, 1),

    regexp_substr (String,'>(.*?))

    regexp_substr (String,'<.+?>. *? ) (.*) $', 1, 1, null, 1)

    Chopper

    where regexp_substr (string,'<(.*?)>', 1, 1, null, 1) is not null

    )

    Select '4f', seqno, '5f2a', '82', '5f20.

    of (seqno, lower (key) select key, value)

    Chopper

    )

    Pivot (max (value) for key in ('4f' as '4f', '5f20' as '5f20', '5f2a' as '5f2a', "82" as "82"))

    Concerning

    Etbin

  • Is it possible, using ExtendScript, to retrieve the name of a model used in first

    I have an AE Comp used in first instance.  I'm looking for a way to quickly manage the names of the AE model and this model used in the first instance.  The goal is to maintain naming conventions as efficiently and accurately as possible.  I was wondering if there is a way, using ExtendScript (a command in a custom panel) to retrieve the name AE Comp of her in first instance.

    Any projectItem with a path ending with .aep is a likely candidate.

    Our next version provides iteration better the elements in a sequence; You can reach the projectItem of any clip, that should give you what you need.

  • Please share the Script to retrieve the name of host, HBA, HBAstatus, WWN, pathpolicy and dualpathinfo

    Please share the Script to retrieve the name of host, HBA, HBAstatus, WWN, pathpolicy and dualpathinfo

    Take a look on Re: information on the host hardware with information about the HBA drivers and nic

  • What is the searchable property of name ID Spec?

    I have a request to allow the search of trade Spec on description with "contains".  I could not find the searchable property ID to make it available in the drop-down list of search for trades.

    Is there a list of available property, property ID in a document that I forgot?

    The commercial designation has a searchable property ID?

    I have the < EQTSearchablePropertyConfigs >;

    < model modelName = "Trade Specification" >

    < SearchableProperty propertyId = "SpecName" sequence = "1" enabled = "true" comment = "" / > "

    < SearchableProperty = '2' = "SpecNumber" activated sequence propertyId = "true" comment = "" / > "

    < SearchableProperty propertyId = activated "3" = "SystemEquivalent" sequence = "true" comment = "" / > "

    < SearchableProperty propertyId = "GtinUpcNumber" sequence = "4" enabled = "true" comment = "" / > "

    < SearchableProperty propertyId = "Brand" sequence = "5" enabled = "true" comment = "" / > "

    < / template >

    the display of the Source, I can't find anything with the option value = 'Description' I in materials and any other Types of Spec.

    option selected= "selected" value= "-" >-< /option>

    < option value= "SpecName" title= "Name of Spec" >Spec name< /option>

    < option value= "SpecNumber" title= ' Spec # ' >Spec #< /option>

    < option value= "SystemEquivalent" title= 'Équivalent' >equivalent< /option>

    < option value= "GtinUpcNumber" title= "GTIN/UPC/EAN" >GTIN/UPC/EAN< /option>

    < option value= "Brand" title= "Brand" >brand< /option>

    Thank you... - BeckieC

    Curiously, it seems that Description has been forgotten on the search for specification of trade.   We will add it in the next major release.   If you find other criteria, you feel must be go ahead and submit an enhancement request.

    There is a customization that you can do to add new search criteria.  This would be a customization so when you upgrade these changes will need to be reused.

    1. ask the file: Config/Core/EQTModelCustomExtensions.xml support for your specific version.  This file is encrypted in your basic version.  You will need to make changes to this file and replace the encrypted version.  In this file, you can add additional criteria to search models.

    2. Add the following text to the file

    SpecDescriptionFreeTextProp.Description

    gsmBaseTradeSpec.pkid = gsmProductIdentification.fkSpecID

    gsmProductIdentification.pkid = SpecDescriptionFreeTextProp.fkSpecID

    To give you an idea how to add other criteria:

    If you go to our documentation of the schema, you can enter the SQL query for the data you are looking for, as the name of the Spec

    SELECT * FROM t1 gsmBaseTradeSpec

    INNER JOIN t2 ON t1.pkid = t2.fkSpecID gsmProductIdentification

    INNER JOIN SpecDescriptionFreeTextProp ON t2.pkid = t3.fkSpecID t3

    You then that convert to XML format as in the example above.

  • How to retrieve the name of the partition of a deployment process

    Hello

    In a 11g BPEL process I need the partition name (for example - default etc.) in which the process has been deployed. As we buld available function to retrieve the instance id (ora:getCompositeInstanceId ()), we have no function to retrieve the name of the partition?

    Hello

    Try this to affect the business.

          
            
            
          
    

    Kind regards
    Neeraj Sehgal

  • Retrieve the names of files for Linux?

    Hello
    I installed ODI 11 g on windows. and load the multiple file. as you can see that this procedure (script) is used to get the name of the files. using technology "Operating System"
    cmd /c dir D:\test\*.*/b /a:-d > D:\\Filesname.txt. It works well on windows. Now, I want to load these files names that are on the Linux server.
    How will be the script for this
    as my files directory name is Test > > > > that contains files
    Filename.txt > > retrieves the names of the files in the test directory.
    In Linux.

    Thank you

    Concerning

    create a script file using above command and run the script file in odi.

    /Home/user_name/ScriptFile.sh

    It will work.

  • retrieve the Vc:HostSystem host name

    How to retrieve the host name of the object of HostSystem under the api vc3.5.

    I tried

    $host.name host. Name

    Host.info.Name host.info.Name

    Host.Summary.info.Name host.summary.info.Name

    I have a table of host objects I want to choose a host by name.

    var table = new Array();

    (host var cluster.host)

    {

    System.log (host.xxxxxx)

    }

    vCO 4.0 had a 32 bit JRE 1.5, vCO 4.1 has a 64-bit JRE 1.6.

    I don't know if the plugin VIM3.5, you have the 4.0 version works on version 4.1. I'm sure it wasn't something QA teams tested.

    I checked with the doc team. The latest guide mentioning the plugin vim3.5 is the 4.01. It must be available for this version of vCO (4.0 Update 1).

    To be in a position to support, you must install a 4.01, including the plugin vim3.5 vCO in the Install_Directory/extras/plugins folder.

    Ideally of course, you'd have the last corresponding vCO 4.1 / vCenter 4.1 U1.

    Please note that the workflow in writing against the plugin vim3.5 will requires that the types of plug-ins for vim3.5 for plug-ins to VC of refactoring.

    Christophe.

Maybe you are looking for