Put the folder hierarchy information in a report PowerCLI

Here is a script that I currently use to report in my inventory.  It is possible not only the record i.e. a virtual machine in the list, but the folder on top of this folder?  Or even or all folders on top of this folder?

Get-Cluster-name NOMCLUSTER | Get - VM | Select

Name, MemoryMB NumCpu, Description, PowerState, ProvisionedSpaceGB, UsedSpaceGB, Version, VMHost, ResourcePool,

@{N = "HDsizeKB"; E={($_. Hard drives | Measure-Object-CapacityKB property-sum). Sum}} folder,.

@{N = "Datastore"; E={($_ | Get - Datastore). Name}},@{N="#snapshots '; E={($_ | Get - Snapshot). County}},

@{N = 'Name of the OS'; E={$_. Guest.OSFullName}} | Export-Csv "C:\report.csv" - NoTypeInformation

Thank you!

You could do something like that

$tgtEvents = "VmBeingDeployedEvent","VmCreatedEvent","VmRegisteredEvent","VmClonedEvent"

Get-Cluster -Name clustername | Get-VM | select Name,MemoryMB,NumCpu,Description,PowerState,
     ProvisionedSpaceGB,UsedSpaceGB,Version,VMHost,ResourcePool,
     @{N="HDsizeKB";E={($_.Harddisks | Measure-Object -Property CapacityKB -Sum).Sum}},
     @{N="Folder";E={
               $current = Get-View $_.Extensiondata.Parent
            $path = $_.Name
            do {
              $parent = $current
                 if($parent.Name -ne "vm"){$path =  $parent.Name + "\" + $path}
                 if($current.parent){$current = Get-View $current.Parent}
            } while ($current.Parent -ne $null)
            $path}},
     @{N="Datastore";E={($_ | Get-Datastore).Name}},
     @{N="#Snapshots";E={($_ | Get-Snapshot).Count}},
     @{N="OS Name";E={$_.Guest.OSFullName}},
     @{N="CreatedTime";E={($_ | Get-VIEvent -Types Info | where {$tgtEvents -contains $_.Gettype().Name} | `
                                                       Sort-Object -Property CreatedTime -Descending | Select -First 1).CreatedTime}} | `
     Export-Csv "C:\report.csv" -NoTypeInformation -UseCulture

An alternative would be to store the date of creation in a custom attribute. As documented in Alan who created this VM? post.

Once you have the date in a custom attribute that is much easier (and faster) to include in a report.

____________

Blog: LucD notes

Twitter: lucd22

Tags: VMware

Similar Questions

  • How Windows Explorer can be configured to browse the folder hierarchy instead of behaving like a browser?

    I work with files in a folder tree.  I want to browse this folder hierarchy, just as I did in the original copy of Windows Explorer in Windows XP.  I want to use the arrow keys to navigate up and down, and when I'm in a folder and click the previous button, I want it to go up one level in the folder hierarchy, just like he used to.

    Now, when I hit the 'back' button, Windows Explorer behaves as a browserand goes to the last folder that I have read.

    It's so frustrating!  She interrupts my thought process and the movement of my work.  If I wanted to use a browser, I use Internet Explorer.

    How Windows Explorer can be configured to browse the folder hierarchy instead of behaving like a browser?  Remember the "unwebified" of Windows XP Windows Explorer version?  This is what I want so I can get back to work effectively.

    Windows Explorer 7 does not have the up button like XP, however, in the address bar you can select the folder in the hierarchy (sometimes called the trail of bread crumbs) to return.

    Windows 8 added the arrow pointing upwards.

  • Where can I find a tutorial on the folder hierarchy show?

    I have 11 items first, which is also the organizer of the program elements. And I also have Photoshop Elements 10. The organizer elements with video editing software, that's what I'm interested in good. I think that my folder hierarchy is not fair. I want to straighten but I don't know how. Can someone direct me to a tutorial on how to work with the folder hierarchy.

    This could be another issue, but it could be related to my confusion about the folder hierarchy in the Organizer. On June 10 I was copying some photos from my hard drive to the Organizer - probably a stupid thing to do. While I was doing this, the pictures folder (display and organize digital images) not is more took me to all my photos on the hard drive. The pictures folder's subfolders, Documents, music, Control Panel on the Windows 7 Desktop to the right of the menu stuff start.

    When I click on images now I get two files: Adobe and photos. The Adobe file has these values - size: 0 bytes; Contains: 0 files, 1 folder; Created the: Monday, June 10, 2013; Attributes: Read-only (applies only to files in the folder. I deleted the folder Adobe several times but he returns.

    What I really want to do, is to restore my folder image to its original state so that I have access to all the photos of my HDD immediately instead of clicking around these issues. Vaguely, I think that something I did to the folder hierarchy in the optimizer has messed up things on my computer.

    Of what you have listed here, it looks like you have moved your records photo up to a level... sort of. I don't know why computer appears in my images (or perhaps there is just one problem with the way you have indented the list here...). But it looks like you have a lot of your image files moved to the parent folder where one normally would expect them to be.

    The folder my pictures is the name used by Windows XP, Windows Vista and later, the record was simply named images. If I read your right of the list, it looks like you want to take the faces folder that is located in the folder of Tommy and move it to the pictures folder (the one at the bottom of the list, just above D, E, F, G). You will also need to move the folder of Clowns (to the top of the list), in the case of faces that you've just moved in the previous step. If there are images in my pictures, pictures files and/or the faces (the three all at the top of the list), you will want to move them to the folder of images at the bottom of the list.

    All this can be done in the elements Organizer, simply drag and drop a folder to move it from where it is at the location you want.

    For any questions with the help of the elements of first, you'll want to post in the forum first parts of responses: http://forums.adobe.com/community/premiere_elements

  • How to search the folder hierarchy by the parties of a folder name. Is there a library similar to library bookmark folder to facilitate the Organization of record?

    How can I search by folder for the email account names and names of folder of bookmarks by keywords or parts of the name of the folder? Is there a way to enter and to associate keywords to send/benchmark folder names?

    We put all our transactions in messaging and bookmarks in a reversed under the account name and appropriate ISP user tree structure, but often end up with double taxonomic entries under multiple ISP accounts such as Roadrunner or Google-mail address for the same Windows user account and the name. Sometimes I create a same folder in both accounts. Be able to search by folder_name in all e-mail accounts in the same Windows user name would be wonderful to correct the bifurcations in taxonomy of folder name.

    What I do not right - please?

    Please - Chris

    I use the add-on for quick folder move - it has a MRU list and a box of text in which you can type a folder name, with an incremental search phase.

    https://addons.Mozilla.org/en-us/Thunderbird/addon/quick-folder-move/?src=API

    You my also find the QuickFolders useful add-on.

    I also wonder if your deposit under the ISP account is the best way to go. I would look of combining messages from accounts under local folders into an independent style of the account.

  • I put the folder from the HARD drive to another HARD drive?

    Hello

    on my laptop, I have 2 hard drives, the first is vista C:, the second is DATA E:, if I click on DATA E: there is a folder called HDDRecovery and R10061EN.tag
    The HDDrecovery folder is a lot of files and folders, one of them is readme and readme in the file is this warning

    Folder of HARD disk recovery

    Caveat!

    Do not remove or edit these files and folders.
    Any change can damage the HARD drive recovery system!

    So I ask myself, can I put files in E: DATA with the HDDRecovery folder and the R10061EN.tag file?

    C: Vista has only exempt from 74.3 GB 21 GB and DATA E: has 67.9 GB free of 73.2 Go so can put files in DATA E:?

    Of course, you can record what you want on E: but do not remove or change the folder of SD recovery.

    In your case I would first create the recovery discs if you didn t do it. Do not delete something on before E:. Then you can do what you want because you have the discs.

  • How to organize all of the programs in the folder hierarchy?

    I just got Windows 7 after using XP for years.  I like to organize the list of programs on the start menu, depending on the area of functionality (support, business, games, etc.) instead of having a long, long list of programs.  How can I do this with Windows 7?  Right click on the Start button does not open the folder that contains the list of programs.

    1. click on start.
    2. right click on all programs, and click on "Open All Users".
    3. If you want to sort the programs under just your profile, right-click on all programs and click on 'Open' instead.
    4 sort away to your heart's content!

    You can also get the directories of programs through Windows Explorer by copying-pasting the following into your address bar and press ENTER:

    By user: %appdata%\microsoft\windows\Start start\program
    The system-wide: %programdata%\microsoft\windows\Start start\program

    Hope that helps, have a nice day!

    Kristan M. Kenney ("Nighthawk64")

  • maintain the folder hierarchy when you import the HD?

    On my HD, I have a folder called 1-50 top-level, then under folders 1-10, 11-20, 21-30, 31-40, and 41-50.  In a subfolder, 1-10, are sub-sous-records; 1-trip, 2-aunt Sally, 3 - Bob marriage, etc. that actually contains the pictures. Is it possible to import the folder named 1-50 and hold this whole structure?  If this isn't the case, how best to rebuild in Lightroom so that he can find good sources on the hard drive?

    You choose to add (as opposed to the copy or move) on the menu at the top of the import window.

    Which leaves the files in place on your disk.

  • How to delete files in the folder of information system volume on replacement disks?

    How can I delete files that were up on another system (XP), after that I inserted the disc into my new Win 7 system.  The files seem to be impossible to remove.  This is not a progress :)  What can I do to remove these files?  They take a significant amount of space, and I want to be able to put what I want on these drives.  What I have to get out my old XP discs just to do this?  Please tell me I don't have to (: I remember to clean my machine win 98 with the commmands BACK a file and directory at a time.)  I hope were not there...

    rfitzpa877

    , This does not resolve the (ARRRG!) system volume information files, but their size is reduced to nothing...  If someone does not know how to remove these files, I would like to know how.  I formatted one of the disks and apparently not one of these folders have yet.  In fact, I bluff on that partition and formatted & that seems to have managed to get rid of these pesky files on this drive.  Am I the only one who thinks I should have control over my own system?  What is the point of having administrator rights?  Maybe it's time we give administrator rights.  I am not at all impressed by it.  From the looks of the number of points of view on this thread, I'm not the only one with this problem.  If I want to disable the protection and to get rid of the files, why I can't?

    You just started to fall on this real guilty about "kits of infected roots.  Lets imagine that a crime is committed in a House.  who is instantly a suspect?  for example, wife disappears > husband is the first to be questioned.

    In the case of a MS OS Microsoft has really strengthened WAY out of bounds. For half a year that I traced the issue to them anyone who or what that monitor my progress erased my data and sent me to a goose chase 6 months have no opportunity to even connect online for days or weeks I was left down my school because I was not able to turn on a computer to write an assignment or a test with any reliability.
    Who got this abuse power?  They think we did by agreeing to there life private terms or agreeing to use icons 'newer and better '.  They rely solely on the low bar of duty of good faith to steal data, record and claim it as their webcam or any ones and zeros, they feel that theirs with an omniscient power of Microsoft update.  Why is Microsoft blameless when a blue screens after a system command to reboot to make effective change OS
    ? Read the comments around KB976902 and the "fix" KB25533552.  They have simply to virtualize all XP sp3 or later PC.  Using video to measure the ability of the PC performance and disk space querying Microsoft then begins to do what they darn well for as long as they wanted regardless of evil as being spent in graduate school.
    This virtual virus haunts me, but he gave up because I happened to scan hundreds of pages of documents trying to burn DVDs or whatever it is to preserve the legal evidence (paralegals).
    I had scanned drive my license to and many other pages that I think someone out there shows some mercy, at least for a little while.  Behaviour cruel and unusual of sadistic implementation of the 'virtual' virus left me broke and homeless.
    Be aware, WBEM, Panther, winsxs and scoring system they say is in our interest or as these naïve technicians say blindly which is just one possible use of the 'virtual' Virus  Visual Basic and root or environment variables allows them to alter the remote registry or to set a timer to attack even when unplugged on the net.  They have no interest in the individual retail customer or small business owner.   Whenever you read "recommended", it is recommended to allow them to invade and infect their own way.
    What virtual "features" are active I really don't know, when there is literally no control over any aspect of the PC.  They could using Adobe Flash network of peer-to-peer "characteristic" of the network or activate Bluetooth to create a network almost undetectable, replacement of NICs with NDIS based pilots allows them to use USB drivers to emulate any hardware driver, even turn off the LEDS of different.  Only because of the vibration of a drive external hard started to peel the onion.
    I can bet my next "update" will be what I call and copyright 'virtual Virus '.
    It is my opinion based on my experience real and even documenting months and months of troubleshooting the data I recorded full time has of course changed or deleted.   These facts showed me that Microsoft et al. will do anything even my personal destruction for nothing more than try to get control of my own personal private property.
    By diligent and hundreds of thousands of hours, I am convinced all my personal files are monitored without legal or judicial supervision.
    So yes, deleting these files is not only the best of the options, it leaves the possibility of attacking or anything be it launch at will and, therefore, it IS THE ONLY OPTION.
    Hidden in the desktop.ini, fonts and all files are really seeds of the worst violations of privacy, not yet imagined by most computer experts or instructions.  Our worst enemy is so once more one inside not the perception of the public of the hacker tracking.
    I submit, piracy of Microsoft operating systems is now a 2nd Amendment RIGHT because they used their OS as a weapon as damaging as any gun could be data that they killed.
    By doing so and by my expert opinion and the notation of the inalienable right of the privacy of the citizens of CA. Microsoft has eliminated any claim of a right to valid author or license because they use EULA another company in they create and manage folders.
    The 'virtual' Virus is clever that, as long as it is insidious.  If they deny then I ask the State of the art and my invention.  I can then request the return in court.  My remedy supposed today
    ?  I am only allowed the cost of the operating system regardless of the magnitude of the fraud and damage that they did to me
    It is clearly stated in the EULA that they believe is valid.
    Until one day I hope to be able to have my day in court before a jury educated I'm destined to become outcast among our society.
    What a difference a year and this little compassion to tears shed my life dissolves around me.
    My confidence they would eventually do the right thing has turned out to be my worst enemy
    .
    Virtual virus alien.
  • Files and Settings Transfer Wizard has been used to record all my info. I installed a new drive and a fresh install of XP Pro. When I reverse the process and navigate to the folder, it will not recognize the path to the folder or information. What should

    Had to install a legal copy of XP Pro., so I also installed a better hard drive. I got all the information on the use of the files and Settings Transfer Wizard. The directions were quite easy and I transferred the information on my other hard drive without any problem. Once everything was installed, I tried to recover the said info. I failed.

    Hello

    There are three points of important control you need to follow in order to extract the files and settings of the F.A.S.T. see image:

    Dealing with corrupt files and transfer settings (F.A.S.T.) image Assistant:
    http://WindowsXP.MVPs.org/fast.htm
    Ramesh Srinivasan, Microsoft MVP [Windows Desktop Experience]

  • Create the folder hierarchy

    Hi all!

    I need a function that creates folders,

    Create A folder on the target "C:/test/123 / '.

    If A file exists on the target "C:/test/123 /" then create folder B on the target "C:/test/123 / '.

    If the B folder exists on the target "C:/test/123 /" then create folder B on the target "C:/test/123 / '.

    If file B exists then create file C on target "C:/test/123 / '.

    Could someone help me with this function

    Thanks in advance

    Try this,

    var target = Folder.selectDialog("Choose a target folder");
    if(!(Folder(target+"/"+"Folder A")).exists)
    {
            new Folder(target + "/" + "Folder A").create();
        }
    else if(!(Folder(target+"/"+"Folder B")).exists)
    {
            new Folder(target + "/" + "Folder B").create();
        }
    else if(!(Folder(target+"/"+"Folder C")).exists)
    {
            new Folder(target + "/" + "Folder C").create();
        }
    else
    {
            new Folder(target + "/" + "Folder D").create();
        }
    

    Kind regards

    Cognet

  • I can't open or open the folder containing information that I downloaded!

    When I download a file, it appears in the download list, but I am unable to do anything with it or copy it to another location.

    It is possible that anti-virus software is corrupt downloaded files or otherwise interferes with the download of files.

    Try disabling analysis in real time (live) files in your software anti-virus temporarily to see if that makes working download.

    See:

  • Is there a way to put the folder my documents on the home screen

    Aloha all, I was wondering if there is a way to have my documents on my Mac, show on my iPhone 6 s homepage without using Dropbox?

    See the iCloud drive on the home screen

    http://osxdaily.com/2015/10/05/show-icloud-drive-home-screen-iOS/

  • Where is the folder of the WCC UI hierarchy?

    I use WCC 12 c.

    I read here that there must be a hierarchy of folders in the sidebar of the page of 'Browse' user interface. However, the area is blank on my local site.

    How can I configure to display?

    sidebar.png

    Hello

    In the documentation it says that the folder hierarchy shows that when you select a library.

    Check: http://docs.oracle.com/middleware/1221/wcc/WCCUS/GUID-67635B4F-98C9-45DC-AC70-689060266B58.htm#WCCUS2213

  • When Outlook Express 6 detects emails from a name in the right column indicates the folder in which it is in. How can you tell which folder this folder is located in?

    Column of Outlook Express folder in find

    When Outlook Express 6 detects emails from a name in the right column indicates the folder in which it is in. How can you tell which folder this folder is located in?

    OE does not have the capacity to tell you where the folder is located in the folder hierarchy.  You can select different trees under local folders to find what subfolder is and what kind of tree it is under.  Unless folders.dbx is corrupted (which happens a bit), then OE will not create folders for you.  If folders.dbx is corrupt or not, I would suggest that you backup the files and the registry (see www.oehelp.com/OETips.aspx#6) before things become corrupt, because you seem to have a complex organization from your e-mail folders.

    Steve

  • E4200 Media Server ignores my folder hierarchy

    I have a 1 TB drive, attached to my E4200 that contains several videos sorted into a hierarchy of folders like this (these are just examples):

    TV shows

    Supernatural

    01 episode 1.mp4

    02 episode 2.mp4

    Burn notice

    01 episode 1.mp4

    02 episode 2.mp4

    Doctor Who

    01 episode 1.mp4

    02 episode 2.mp4

    Movies

    Star Wars IV.mp4

    Star Trek 2.mp4

    Children

    Sesame Street

    01 episode 1.mp4

    02 episode 2.mp4

    Movies

    Bolt.MP4

    Cars 2.mp4

    As you can see, all of my videos are in a carefully constructed hierarchy.  It works with my old server media (Rivet for Mac).  On the E4200, however, all of those MP4 files are merged.  My Xbox shows folders as 'Albums' and 'Date', but they don't really mean anything - all of my videos are blurred in these files and there is no way that I can find something.

    Here is the configuration of the media server:

    Can someone tell me how to solve this problem?  If I can't find a solution, that the media, the server of this router functionality is absolutely useless for me.

    Thanks for the reply, but that does not help.

    I found the solution.  It seems that the router (or the software of Twonky, I guess) merges all records top level together, treating them as a virtual folder.  Somehow, this disrupts the software and he loses the folder hierarchy. I expect each scanned folder to appear as its own entry on my Xbox.

    I fixed it by scanning only the root folder.  Everything works now as expected.  It would be nice if I could disable all sorting options, because they are unnecessary, but I can live with that.

Maybe you are looking for

  • Funky problem continuously with a specific application

    This problem could be related to how this app was designed, but I thought someone here might know a hardware fix. Streaming of any application to airports is easy-peasy, but this particular application of the Apple TV streaming is a real struggle - b

  • Vista.vhd can be upgraded with windows 8

    My system is i3 w/10 gb mem, 500 GB drive, Windows 7 pro is installed. I love Windows 7 but I don't want to upgrade to Windows 8 until I really test. My question is: I want to install my old version of vista home in the .vhd drive & upgraded to windo

  • Laptop HP 250 3 g (J0Y21EA): problem of unknown devices

    I installed Windows 8.1, but my Device Manager shows 5 mistakes of devices in the section "other devices." They are as follows: Unknown device (location: on system compatible ACPI Microsoft) ACPI\VEN_HPQ & DEV_6001ACPI\HPQ6001* HPQ6001 Unknown device

  • error message 0 x 80070570 when you try to delete files

    I get this error message when you try to delete files on my hard drive. I would be greatfull if any 1 can help me remove these files.

  • How to customize sensitivity for scrolling click-and-hold?

    Hi guys,. This could be a tough ask but: I love the scroll by click and hold the mouse wheel (or the middle button). Any ideas on how to make more sensitive while it scrolls a longer distance with less movement of the cursor? Note, I don't want to no