Sum and average properties of the object

I try to take an existing report and add sum and average of some properties.

Can I get the sum and the average of the following properties for all virtual machines listed in this report?

  • Space in use
  • Space used
  • Free space
  • MemoryGB
  • vCPU County

Thank you!

$report = get-VIEvent - MaxSamples ([int]: MaxValue)-start (Get-Date). AddDays(-9)-done (Get-Date).adddays(-8) |

Where-Object {"VmCreatedEvent", "VmClonedEvent", "VmDeployedEvent" - contains $_.} GetType(). Name} | %{

$evtThisNewVMEvent = $_

Try {}

$vm = get-VM-Id $_. Vm.VM - ErrorAction Stop

}

Catch {}

return

}

$vm | Select @{N = 'The virtual computer name'; {E = {$_.name}},

@{N = 'vCPU Count'; E={$_. NumCPU}},

@{N = "MΘmoire (GB)"; E={$_. MemoryGB}},

@{N = "Space Provioned - full VM (GB)"; E = {[math]: Round (($_.))} {{(ProvisionedSpaceGB), 1)}}.

@{N = 'Space - used whole VM (GB)'; E = {[math]: Round (($_.))} {{(UsedSpaceGB), 1)}}.

@{N = 'Free space - set VM (GB)'; E = {[math]: Round (($_.))} ProvisionedSpaceGB - $_. {{(UsedSpaceGB), 1)}}.

@{N = "Createduserid"; {E = {$evtThisNewVMEvent.createdTime}}.

} | Sort-Object Createduserid

Hello, TheVMinator-

If the intention is just to have another object in the variable $report already has the sum of the MemoryGB of all the objects in the $report variable, you can add another object to the $report variable, such as:

## add new object to the array of objects, whose MemoryGB value is the sum of all of the memory of the objects already in the array$report += New-Object -TypeName PSObject -Property @{"VM Name"="SumOfAllMemory"; "MemoryGB" = ($report | Measure -Sum MemoryGB).Sum}

Who can become confusing in the future when someone checks for all virtual machines and their quantity of memory and see as a virtual machine named "SumOfAllMemory" with a value of MemoryGB to .  But, is this what you are talking about?

Tags: VMware

Similar Questions

  • question about documenting the properties of the object

    The new version of the Designer has a tool that allows us to print a report that displays the properties of the object used in a form template? For example... showing all properties such as size, models, fonts, by default, if a field is required or not, etc...? I also check to see if this feature has been added to the Workbench for forms and for process cards too.

    Neal:

    This looks like a problem, you can solve with a designer macro.

    I have a sample macro that will summarize the properties for all objects in a form.

    You can customize the macro so that it reported on the selected objects

    The macro is described here:

    http://blogs.Adobe.com/formfeed/2011/05/updated-form-report-tool.html

    The latest version of the macro is here:

    http://blogs.Adobe.com/formfeed/2011/09/more-macro-goodies.html

    John

  • How can I spy on the properties of the object using oats 9.1

    Hi all

    How can I spy on the properties of the object in the oracle applications using oats9.1

    and also how to retrieve data from a database.

    Please help me on this point.

    Thank you
    Sudhir

    Hi sudhir,

    During recording, you can activate by clickign the icon 'Add Test object' object browser on the toolbar. You can highlight the object on the page and select by pressing F10. In the dialog box, and then choose the properties you want to test.

    See you soon,.
    Jamie

  • Setting the properties of the object in a class

    There is this contentItem class. The instance has been created well and all properties, with the exception of "maincopy", has been successfully. Now when I buckle my xml (the real path to the xml nodes have been removed for readability), the object in the class is not attributed correctly. In fact, it seems, that it is not given to all the...

    Why the undefined? It traces the "Accessories" "obj [Props]" correctly!
    Thanks for the help.

    Solution:

    var temp : ContentItem = new ContentItem(aNode.nodeName+"/"+R.link);
    and do all the public instead of private properties.

  • How to see the VSwitch and PortGroup properties in the managed object browser

    Hello

    We have a laboratory infrastructure VI3, with a VC and some ESX servers running.

    In the managed object browser, I'd like to see the properties of certain objects,

    especially the VSwitches and exchanges.

    How do I see VSwitch and exchanges from the CROWD. Here's my data:

    ESX IP address: 192.188.0.228

    VSwitch name: vSwitch0

    The port group name: VM_PG

    I know that we can see these properties of Client VI, but I really want to see values

    returned for each of the attributes defined in the WSDL file and the CROWD precisely

    allows me to do. This will help me to do a bit on our end of modeling.

    I tried, but I couldn't really vSwitch. Grateful if someone can give inputs.

    Thank you

    Try this:

    https://A.B.C.D/mob/?moid=ha-host&doPath=config.network
    

    and more precisely which lists out them the portgroup and vSwitches

    https://A.B.C.D/mob/?moid=ha-host&doPath=config.network
    

    =========================================================================

    William Lam

    VMware vExpert 2009

    Scripts for VMware ESX/ESXi and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

    http://Twitter.com/lamw

  • REST api call for the properties of the object in the html bridge provides resource not found (404) error.

    Hello

    I added a bridge Html summary view to our existing plugin (which is in Flex). The html page is displayed in the Summary tab with static data like images and titles. But the .gestJSON of the REST api call fails with the error ' could not load resources: the server responded with a 404 (Not Found) status.

    I followed the bridge Html sample chassisB (chassis - summary.js and html) to create the new page.

    Web.XML of the user interface of the plugin is configured to map/rest / *. bean dataAccessController is defined in the bundle context.

    Java package has the DataAccessController same class as the DataAccessController chassisB class

    This is the URL that I see in the javascript debugger and call API is a failure for this url.  There is no error in the virgo.log.

    https:// /vsphere-client/webui_ui_ns/rest/data/properties/323de5b9-4D2E-4dd7-ae32-98277dd44e90%252Fmf8k-h38?properties=name,model,version < vcenter ip >

    webui_ui_ns-client/vSphere is the value of Web-ContextPath in the plugin MANIFESTO. MF

    I spent a lot of time to understand the issue, but no luck. What I'm doing wrong here? Any help is appreciated.

    version of vCenter server appliance 6.0.0

    SDK - vSphere SDK Web 5.5.0

    1.7.0_79 64-bit JDK

    Thank you

    Deepa

    It was a configuration problem. I missed the tag in the bundle context of spring.

    After you add the 2 lines, it worked.

    Thanks for your time.

  • Properties of the objects in the original application reference

    I continue to ask this question, maybe it's the wrong question,

    but here again:

    Why can't change properties in the main application for a component of the original application?

    Thank you

    Doug

    change of the cn you... but the best way is to loosely couple both the parent and the child of the parent using the communication of custom events/event based.

    so, to use in this case custom events.

    http://cookbooks.Adobe.com/post_Very_simple_example_of_using_custom_events_to_pass-15466.h tml

    Oops... Looks like I already helped you on this...... Laughing out loud! still struggling?

    Post edited by: saisri2k2

  • Properties of the object using nested in the dataField DataGrid

    I fill a DataGrid with an ArrayCollection of objects collection. Each of these objects has a property that is itself an object. I want to use a property of the object of the second (or "nested") as a dataField for one of my articles.

    No idea how to make this work? A rendering custom element would be the only way?

    ~ dimival:

    Thanks for the reminder. I use point made almost exclusively, so I forgot about the functions of label. I was able to make it work like this:

  • A loop in the properties of the object?

    Hello

    I have a clip with the 'class name' block, I'll use this object more than once in the stadium, so I need a loop through it, I was able to do, but I can't access their properties (x, y, height, width, etc...)

    Here is the code:

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

    blocks of var: Array = new Array;

    blocks is the table that contains the movieClips

    for (var i = 0; i < numChildren; i ++)

    {

    If (getChildAt (i) block)

    {

    should what I write here to make the variable blocks [i] a movieClip and access its properties?

    }

    }

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

    Thank you

    If you still want to take the approach that you have started, you probably don't want be melting blocks on the value i if there are children who are not block objects.

    If (getChildAt (i) block) {}

    blocks.push (MovieClip (getChildAt (i)));

    SomeProperty = MovieClip (getChildAt (i)) .someproperty;

    }

  • How to click to view the object and click to hide the object

    I'm very new to Flash and I create an ad that has a simple animation that cycles between two pieces of content. I including, but I have a button on the lower part called 'Important information' and clicking on, I want to bring up a screen that displays important information. I want there to be a 'Close' button on the important information screen, which brings back you to the animation. What is the best way to do it? I have trouble finding a tutorial, but for me, it doesn't seem like a rare action.

    With the help of professional Flash Action Script 3.0 and CC 2015

    There are several ways to do it, but all require that your screen is an object.  a clip that you create in the IDE would be typical.

    Add the movieclip on the stage where you want it to appear and assign it an instance name, for example info_mc.

    during your use of actionscript Panel:

    removeChild (info_mc);  to remove the display info_mc and the addChild (info_mc) to get it back on top of everything else.

    for a button trigger info_mc reappear:

    btn.addEventListener (MouseEvent.CLICK, infoF);

    function infoF(e:MouseEvent):void {}

    addChild (info_mc);

    }

    the code for the close button will also call a listener function that executes removeChild (info_mc)

  • CS6 Illustrator crashes when click-and - drag to move the object.

    Run 16.0.5 on a MBP OSX 10.9.5 the retina. Whenever I try to drag an object to move, Illustrator crashes. I can click on an object/points and move with my keyboard arrow keys, but not with the mouse or trackpad. I have reimagee my machine, with all fees install cs, but the problem persists. All tracks for a solution are appreciated.

    e,

    The problem may be caused by the extension Chrome Pushbullet, see this post by Matt #3 with solution.

    https://forums.Adobe.com/message/6984777#6984777

    or by the Adobe color extension, see this post #2 of byhexxstatic with the solution,

    https://forums.Adobe.com/message/7095368#7095368

    or you could try to reinstall using step three way:

    Uninstall, run the cleanup tool and reinstall.

    http://www.Adobe.com/support/contact/cscleanertool.html

  • Need to control the properties of the objects in another component

    The following is a model of this request:

    < application >

    ... < component: customPanel >

    ... < customClass:CustomTextArea id = "ct_2" / >

    ... < customClass:CustomTextArea id = "ct_3" / >

    .

    .

    .

    ... < customClass:CustomTextArea id = "ct_n" / >

    ... < / component: customPanel >

    ... < component: infoBox >

    ... < button click = "clickHandlerX (event): / >"

    ... < / component: infoBox >

    < / application >

    I want to change the properties of ct_2, ct_3... ct_n button with clickHandlerX.  Currently the infoBox doesn't seem to know the ct_2 etc.

    Thank you

    Doug

    It is more a matter of architecture, you can start looking at frameworks/microarchitectures and best practices when it comes

    dependencies in the application.

  • Set the properties of the object in the constructor?

    I thought that the new object ({prop: true, prop2:false});}) a syntax appropriate for that...

    Ah like this: var obj:Object = ({prop: true, prop2:false});})

  • question about document process plans and the properties of the form object

    The new version of the Workbench has a tool that allows us to print a report that displays the properties of the object used in a model or process shape card? For example... showing all properties such as size, models, fonts, by default, if a field is required or not, etc...? I also check to see if this feature has been added to the Workbench for Process Maps?

    No, it isn't, but there is a blog by John Briinkman entry that will analyze your form template give you some of this information. Here is a link to the blog entry:

    http://blogs.Adobe.com/formfeed/2011/05/updated-form-report-tool.html

    Paul

  • Access to all the properties of all objects in a Subvi

    Dear all

    I need to change some properties of the objects on the front panel in an another Subvi, I don't want to do a 'reference' for each object, and then manipulate its properties in an another Subvi, I want to send some how a reference that contains information for all the subjects in the subVIand and then finally within the Subvi I decide about the objects and their properties that I'm about to manipulate.

    So far, I sent the reference to "ThisVI" in my Subvi and try to access "all objects []" on the Panel and then try to query all objects corresponding to my object to and then manipulate the properties I want (attached image). But the problem is that the properties are different from each specific objecton Panel and I am not as free asI was the main VI.

    For example in the attached picture, is it possible to change a Boolean value in this way?

    Thanks in advance!

    Best regards

    Afshin

    Afshin salvation,

    Yes it works also for other references like graphical waveform. If you use the constant class to more specific "strict refnum", then you get all properties for this purpose.

    Mike

Maybe you are looking for

  • Firefox crashes and freeze then quickly spread to the rest of the computer, forcing a cold reboot.

    The problem started a few weeks back. I would be browsing the web with several tabs open, when suddenly the browser would freeze, get stuck on the spinning wheel.As a first step, it would be that the Firefox that froze, but in the space of a few minu

  • Spectrum of writing and reading spectrum

    Hi, I am currently busy writing read an optics Oceans USB 2000 spectres + I need to take 20 lightspectra of samples and connect these Spectra I have a file for analysis later.  Logging seems to be no problem but read the correctly.  The Spectra does

  • Reset account password

    I tried to change my password from the main account for singing on the computor and somehow the new password did not even my old password does not work now. How can I fix

  • error of msoe.dll in internet explorer 8

    I'm having a problem opening to the top of my e-mail with internet explore. I use Vista 64, Internet Explorer 8 and Windows Mail with a linked gmail account. When I click on which in the past has been an e-mail link, I get the following message: Wind

  • vector of smash protection is activated... why!

    Really frustrated with the message that keeps popping up--being "vector smash protection is enabled."It means in fact (some sites at least) any time I try to play a video/presentation or something else, the screen remains black and nothing happens.Fi