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.

Tags: VMware

Similar Questions

  • Videos captured in different rates can be combined on the same timeline?

    Am a bit confused on combining different video segments on the same timeline.

    Can be combined on the same timeline segments of 720 p and 1080 p?

    Video sequences filmed in different cadences are combined and exported together in a movie?

    If you take a video captured at 60 p can be exported to 30 p - and - play in slomo?

    Thanks for your help

    When you start a new project, the button settings are on the Panel of the new project.

    Furthermore, in any version after version 11 program, the program will automatically set your project settings based on the first clip on your timeline.

  • Photos and video can be combined in the same presentation

    I know this is a noob question. Just bought Elements 8 for the purposes of using video wedding HD to my son yesterday and pictures of amature coupled with music to show the wedding reception this weekend. They were married on a cruise ship. To mix the two, can do that?

    Of course they can! It is part of the fun.

    Remember - for best results (per the FAQ on the right of this forum) resizing your photos do not exceed 1000 x 750 pixels before putting them in a project.

    You can also look into keyframing and create paths (pans & zooms around the photo) something that can make even still pictures seem to be alive and moving.

  • Use the same script in different areas?

    Is it possible to use the same script in different areas?

    I had several scripts that will validate and modify the entries in the user on different areas. Since they do exactly the same thing, is it not possible to just get out the 'real' on a field script and refer to other fields to this script?

    Of course - we have a fragment of 'commonScriptObjects.xdp' that we all have

    our common methods of javascript in.  Then we add to the form and hide it.

    then use the following reference to point to the script object:

    GET A HANDLE TO THE SCRIPT OBJECT

    var commonScript =

    xfa.resolveNode ("commonScriptObjectsFrag.fragmentScript");

    CALL A JAVASCRIPT METHOD IN THE SCRIPT OBJECT

    commonScript.setupSearch ();

    Here's something else you can do to validate our mandatory fields.  We spend in

    the real to validate field and the name of the field as a text string:

    If (! commonScript.validateRequired (mainContentSubform.customerName,)

    False return 'Customer'));

    and the validateRequired method, which is in our commonScriptObject xdp

    file, looks like this:

    validate required fields

    function validateRequired (oField, fieldName) {}

    Console.println ("enter validateRequired");

    var commonScript =

    xfa.resolveNode ("commonScriptObjectsFrag.fragmentScript");

    If (commonScript.isNullValue (oField.rawValue))

    {

    xfa.host.messageBox ("Please fill out the '" + fieldName +)

    ("' field.", "Error", 3);

    xfa.host.setFocus (oField);

    Returns false;

    }

    Returns true;

    }

    Hope that helps,

    Elaine

    ocen12 [email protected]>

    29/07/2009 09:26

    Please respond to the

    [email protected]

    TO

    Amal [email protected]Schmitz >

    CC

    Object

    Use the same script in different areas?

    Is it possible to use the same script in different areas?

    I had several scripts that will validate and modify the entries in the user on

    different areas. Since they all do exactly the same thing, is not

    possible to just get out the 'real' on a field script and refer to the

    other areas of this script?

  • When you use the NI-CAN Transmit sample receive the same Harbor; can a virtual CAN channel (RCA or 257) be used?

    I work for a company that produces and transforms electric parts. We strive to get in remission at nine of the ECU, experiences, Instrument clusters etc. I'm trying to learn how to use LabVIEW to write commands and read the data on the CAN bus. I have downloaded the NI-CAN driver. I am currently 'play' with the same reception Port.VI show in the basic frame of the finder example API folder OR. I am not able to send the number in the data to write the table that it be read by the ncReadNet Mult .vi. When I put the parameter to 'Pending entries reading' the ncGetAttr.vi returns a 0 to indicate that there are no frames to read. As a result, the Mult.vi ncReadNet does not run.

    I don't have any connected equipment, I use the virtual CAN channel CAN256. Is this the reason why I can't get data frames in my queue for the Mult.vi ncReadNet to read?

    When you use the NI-CAN Transmit sample receive the same Harbor; can a virtual CAN channel (RCA or 257) be used?

    CAN carry 256 and 257 are connected to eachother through software.  When you write about 256, you can read the data on 257 and vice versa.  I think the example you mention is a writing and reading on the same port, but what you want is to probably to make a copy of this VI, in order to run two at once, where it opens 256 and the other opens 257.  Then, when you write one that you will see on the other.  I think you might be able to use the test panel CAN too read an and use the example of the other.

  • Error 0x800CCC0F Outlook Express can duplicate the same messages from yesterday, and I can't delete them.

    Original title: outlook can duplicate the same messages from yesterday, and I can't delete them.

    I use outlook express for my e-mail yesterday same emails keep coming, I tried to remove them, but can't everytime I open outlook I get the same


    The other post:
    I opened outlook express the same messages from yesterday, continue to repeat every time error 0x800CCC0F had no new messages and I can't delete these messages

    Hi glendamcmillan,

    You did it all change hardware or software on your computer before this problem?

    You can follow this link & check if the problem persists:

    Troubleshooting error messages that you receive when you try to send and receive e-mail in Outlook and Outlook Express

    Hope the helps of information.

  • Need help to open two images with the same file with different exposures on the screen at the same time in the Photoshop creative cloud (in previous versions we could open two images of the same nef (raw) file and then combine them on the screen with the

    Need help to open two images with the same file with different exposures on the screen at the same time in the Photoshop creative cloud (in previous versions we could open two images of the same nef (raw) file and then combine them on the screen with the move tool. They have become a composite of two layers which could be developed further with the mask tool.

    Hello

    Please go to the preferences > workspace and uncheck the option 'open the document in the tabs '.

    Now you can click on file and choose file > open and open the two images in two different windows which can be arranged side by side.

    Thank you

  • I uninstalled Acrobat CC but I can't reinstall on the same computer

    I uninstalled Acrobat CC but I can't reinstall on the same computer, Application Manager has always said that I installed it in the computer.

    How can I get Application Manager to recognize that Acrobat has been uninstalled once, so I can reinstall?

    Found the answer, apparently I need to uninstall the Acrobat Pro XI in another folder as well. Applications > utilities > Adobe Installers > Adobe Acrobat Pro XI (double-click & Uninstall)

    The rest will follow.

  • Account that a single email can be activated at the same time?

    Hello

    I have two e-mail accounts on the Mail for some time (virginmedia.com and outlook.com). Today, for some reason any Mail keeps asking for the password of the email blank and does not seem to recognize the password (which works fine if I connect on the Virgin account from the internet). Then also the following error message appears "only an e-mail account can be activated at the same time. «The «[email protected] e-mail account activation will disable "... @outlook.com" on this Mas.» How can I solve this?

    Thank you

    10.11.5 OS / iMac (mid-2010)

    You will need at least one of the accounts remove and recreate it in the Internet accounts preferences panel. You can do this without losing all the messages, provided that the account is IMAP or Exchange, and if you store sent messages on the server. Back up all data before making any changes.

  • Several networks of power line can exist simultaneously in the same electrical circuit?

    Several networks of power line can exist simultaneously in the same electrical circuit?

    Thank you

    Yes, as long as you change the encryption keys can have simultaneous powerline of the networks.

    If two units with the encryption key "HomeplugAV" does not connect with two other units with the encryption key 'HomeplugAV2', but the two pairs will work independent of each other.

    Hope this helps

  • Question of curiosity: several versions of LabWindows CVI can be installed on the same PC?

    I'm curious.  Several versions of LabWindows CVI can be installed on the same PC?

    I'm used to LabVIEW, where Yes, it is possible.  However, with CVI, other than the additional support with newer versions, there may not be a problem to return to an earlier version.  I still wonder.  Several versions can coexist in the same PC?  Or they affect each other?

    Curious...

    R

    You can, BUT only one (the last) version of the CVI runtime will be installed - this behavior began with CVI 6 or more.  Before that date, you have completely installed parallel to several versions of the CVI.

    This can be a problem if you ever find that you have applications depend on a particular version of the RTE.  Theory of NI is that this editor is always backward compatible.

    And you might ask what is simply the RTE - the answer is that it is a set of DLLS and stuff that NEITHER really cares to list for you.

    Menchar

  • How is it that a computer which works very well with a direct Ethernet connection won't work with a switch, however any other computer using the same port, cable, ect, and so on, can?

    Switch issues. Help, please.

    How is it that a computer which works very well with a direct Ethernet connection won't work with a switch, however any other computer using the same port, cable, ect, and so on, can? We already checked the firewall as a question, that it was not, and now, we are puzzled.

    Well, I know that the issue is long-term... believe me, it's a long, but as they say, the devil is in the details. Anywho, the question is, my grandfather has a HP laptop, which for two years has been able to run through a Linksys switch to his router and connect its printers to his laptop. About two months ago it suddenly doesn't work like that. Now, it works fine if it plugs directly into the router/Ethernet. My uncle suggested that the switch was bad, but after testing the same port, cable and all, the switch worked well for him. ' GRAMPS really needs this answered, but someone else, it is called can not understand and now I, in turn, ask you all for what you can offer. Here are the ideas that we have already discredited.

    -Switch bad: as above, is that this particular laptop, even under identical conditions, the works of my uncle very well.
    -Bad NIC: debunked through the fact we connected to the computer directly to the router and it worked fine.
    -Bad configuration of the firewall: we have disabled the firewall (please do not notice, he wasn't the smartest idea, we already know) and even if she recorded the switch exists, the internet is always triggered when you are connected with the switch.

    Thanks in advance for any assistance that you can provide and Merry Christmas to you all.

    It would be useful to consult the results of the ipconfig/all command both when it is connected to the switch and when it is connected directly to the router.  In addition, what is the model of the switch?

    To save the manual copy and the new hits of the ipconfig/all command output-

    First connect through switch.
    Open a command prompt window (start > run > cmd > OK)
    Type the following lines in the black command prompt window and press ENTER after each line

    echo "Connected via the button" > "% UserProfile%\Desktop\ipinfo.txt".
    ipconfig/all > "% UserProfile%\Desktop\ipinfo.txt".

    Now connect directly to the router, type the following lines in the command prompt window and press ENTER after each line

    echo "Connected to the router" > "% UserProfile%\Desktop\ipinfo.txt".
    ipconfig/all > "% UserProfile%\Desktop\ipinfo.txt".
    Notepad '% UserProfile%\Desktop\ipinfo.txt '.
    output

    Copy the contents of the Notepad window in your response (if you use the laptop when it is connected directly to the router) or close the Notepad window, and then copy ipinfo.txt of the laptop to the Gramps in a USB FlashDrive you can connect to any computer allows you to answer.

    You can delete ipinfo.txt on the desktop when you are finished.

  • I get the same files repeat KB and how to stop it?

    I get the same files repeat KB and how to stop it?

    The KB record number are KB2478663 and KB2518870.

    Mike

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_vista-windows_update/how-to-stop-the-KB-file-from-keeping-repeating-to/21fb21b2-9a13-4261-9c1a-e7ef90a9e6a0

  • When downloading to the sd card how can I stop downloading the same pictures?

    When you transfer the pictures from my card how can I stop downloading the same pictures again?

    You can delete old photos to the SD card in the device or the computer.  You can also choose the option to select only the images you want.

    Good luck.

  • HOW MANY DEVICE CAN BE USED AT THE SAME TIME?

    Hi all

    I would choose the plan of the student to study in September, I would like to understand how much peripheral can be used at the same time? Because I have an IMac at home and also MacBook Pro retina for use at school? Can I download and use it on this two computer at the same time?

    waiting for response and thanks a lot!

    Cloud license allows 2 activations to time http://www.adobe.com/legal/licenses-terms.html

    -pdf of 200 http://www.adobe.com/content/dam/Adobe/en/legal/servicetou/Software_Terms-en_US-20150601_2.

    -Install on a 2nd computer http://forums.adobe.com/thread/1452292?tstart=0

    -https://helpx.adobe.com/creative-cloud/help/sign-in-out-activate-apps.html

    -Windows or Mac has no importance... 2 on the same operating system or 1 on each

    -Two activations on one account CAN NOT be used at the same time (to be noted in the link above of the license)

    -An individual account is for one person and may not be shared with anyone else

Maybe you are looking for

  • NEW update of Adobe RAW plugin v1.2

    All, We have updated the Adobe RAW plugin, Adobe output CC are now supported. v1.2 Please download below. RAW plugin for Adobe (PLAD-RW1) This plug-in supports files MXF RAW Sony (F65, F55/PMW-F5 and NEX-FS700) in Adobe first Pro CC and CS6 products,

  • 6218 USB NOT recognized

    Hello! I need help to understand (and perhaps fix ) a problem with a peripheral USB-6218. In some of our test engine test bed systems, we have NI USB-6218 devices of additional analog inputs. After a few months of normal activity, when I plug the usb

  • "User profile could not be loaded" on Compaq 6710 computer b laptop Vista Business runningng

    I came home from a 2 week stay to find that I couldn't connect to my laptop. At the time I was absent the laptop was turned off. When I enter the password to logon I get: "the user profile Service service has no logon. User profile cannot be loaded. 

  • Cannot find header fan - G62 b29SA

    My friend owns a HP G62 laptop. He said that the fan has stopped working and I couldn't hear or feel so I'm a fan again and we opened the laptop. It turned out that the fan that I had purchased was not compatible. Later, I tested the fan using a 3 V

  • When I send an email from Outlook Express, it is sent several times, usually happens when sending electronic mail to the affiliate

    When I send email to the affiliate, it will send several times, fill their Inbox, and then the returned several e-mails to fill my Inbox. I have sent emails of the sample to my personal account, and that works well, except when I attach a pdf file, t