PowerCLI

 View Only
  • 1.  RVTools - Run against a specific data center

    Posted Feb 03, 2022 12:42 AM
      |   view attached

    Is there a way to run RVTools against a specific data center within Virtual Center?

    Also, is there a way to export just specific data to Excel?

    I basically need about 20 columns from the million that RVTools spits out. 

    I've also tried using Powershell to extract just the columns I need but, RVTools creates Excel files with two row 1's.  So I get "Duplicate Header" errors whenever I try to manipulate things with Powershell.  It's more like there's 2 copies of the whole spreadsheet. If you unfreeze the top row, when you expand it, it's two spreadsheets. (See screenshot)

     

     



  • 2.  RE: RVTools - Run against a specific data center

    Posted Feb 03, 2022 12:59 AM

    If you hadn't found it yet, this blog post help? - not mine, found on a quick inter-webs search

    RVTools: Parse Multiple Outputs Using Powershell – VirtJunkie



  • 3.  RE: RVTools - Run against a specific data center

    Posted Feb 07, 2022 04:14 PM

    That's actually one of the blogs that I was using.  My problem is that as soon as  I try to do Import-excel, it fails because the spreadsheet RvTools generates had duplicate headers.



  • 4.  RE: RVTools - Run against a specific data center

    Posted Feb 03, 2022 06:36 PM

    You may not even need any scripts, or third party tools.
    Please see whether "RVToolsMergeExcelFiles" (in the RVTools documentation) is what you are looking for.

    André



  • 5.  RE: RVTools - Run against a specific data center

    Posted Feb 07, 2022 04:15 PM

    I'm using that command too.  I have a spreadsheet for 3 different virtual centers. The "RVToolsMergeExcelFiles" works great to put them all into one spreadsheet.  It's just getting rid of unneeded columns that I'm having an issue with.



  • 6.  RE: RVTools - Run against a specific data center

    Posted Feb 07, 2022 04:46 PM

    The ImportExcel module has a cmdlet Merge-MultipleSheets that allows you to merge multiple XLSX files.
    The cmdlet has an ExcludeProperty parameter, that allows you to specify which columns to leave out.