Problems with running script by using the Get-Content cmdlet

#Code to generate the report.

##-------------------------

$vm = gc "vm.txt."

and {foreach ($vm in Get-VM-location $DC) {}

$parent is get-view $vm. ExtensionData.Parent

$path = $vm. Name

While ($parent. Parent) {}

if($parent.) Name - only "vm") {}

$path = $parent. Name + "\" + $path

}

$parent = get-view $parent.parent

}

# < #.

Get-Datastore - VM $vm |

Select @{N = 'Cluster'; E = {Get-Cluster - VM $vm |} {{Select - ExpandProperty name}}.

@{N = "DataStore"; E={$_. Name}},

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

@{N = 'Path of the VM'; E = {$path}},

@{N = "ProvisionedStorage"; E = {Get-FriendlyUnit-value ($vm. ProvisionedSpaceGB * 1 GB) | % {"{0, 7:f2} {1,2} ' f $_"} Value, $_. Unit}}}.

@{N = "UsedStorage"; E = {Get-FriendlyUnit-value ($vm. UsedSpaceGB * 1 GB) | % {"{0, 7:f2} {1,2} ' f $_"} Value, $_. Unit}}}

}} $report | Export-Xlsx-path $ExcelFile - WorksheetName $DC - AppendWorksheet SheetPosition - end

You could just that lead to the function of export-Xlsx

Get-VM-name $vm |

Select @{N = 'Cluster'; E = {Get-Cluster - VM $_______ |} {{Select - ExpandProperty name}}.

@{N = "DataStore"; E = {Get-Datastore - VM $_______ |} {{Select - ExpandProperty name}}.

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

@{N = 'Path of the VM'; E = {$path}},

@{N = "ProvisionedStorage"; E = {Get-FriendlyUnit-value ($_.)} ProvisionedSpaceGB * 1 GB) | % {"{0, 7:f2} {1,2} ' f $_"} Value, $_. Unit}}}.

@{N = "UsedStorage"; E = {Get-FriendlyUnit-value ($_.)} UsedSpaceGB * 1 GB) | % {"{0, 7:f2} {1,2} ' f $_"} Value, $_. Unit}}} |

Export-Xlsx-path $ExcelFile - WorksheetName $DC - AppendWorksheet SheetPosition - end

Tags: VMware

Similar Questions

  • Script not running task for all objects using the Get-Content cmdlet

    Hello

    For some reason when I run the code following the newspaper bundles are only being dumped for the first host in the hosts.txt file. I have a script that gets the bundles of paper for all hosts in a cluster and rename the cryptic file name to reflect the name of the host with good Luc. I could just use the script to get the beams to all hosts in the cluster, but there are times where I need just one or two hosts in the cluster. Can someone tell me what is the problem with the code below?

    $VC = Read-Host "Enter name vCenter.
    $varHost = get-Content "S:\Get-Logs\hosts.txt".

    ##Connect to VCenter
    SE connect-VIServer $VC - WarningAction SilentlyContinue
    #----------------------------------------------------


    {foreach ($ESX to $varHost)

    $destPath = 'S:\Get-Logs\Logs\$($ESX) ".

    If ((New-Item-chemin $destPath-ItemType répertoire-ErrorAction SilentlyContinue) - eq $null)
    {- New - path $destPath - directory - ErrorAction SilentlyContinue ItemType}

    Get - Log - VMHost $ESX - Bundle - DestinationPath $destPath


    }


    # Disconnect - VIServer
    Disconnect-VIServer *-confirm: $false
    The Script ##End

    Although it would be ideal for the log files should be renamed at this point I would be happy if the script would create a folder for each host listed in the text file and place the log file in each folder.

    Thank you

    The variable $ESX contains only a string, not a Name property.

    If you are referencing $ESX. Name will return nothing

  • Problem with lines in Illustrator using the Wacom Tablet

    Hi all

    I have no idea why I'm having this problem in Illustrator. I use the small Intuos Pen Tablet (CTL-480), and my lines in illustrator is really strange. Even when I turn off the pressure in the brush settings, there is a gap in the line (it takes just one line of the same thickness). The Tablet works perfectly in Photoshop, but because I use the tablet to create art using plates (typography), it is easier and better for me to use illustrator. You are not sure that someone else had a similar problem or know maybe a setting I could change or try to fix it?

    I have attached a picture of the problem.

    Screen Shot 2016-05-06 at 7.58.21 PM.png

    Screen Shot 2016-05-06 at 6.46.21 AM.png

    Thank you for your help.

    This is a known issue.

    If all you want is a line single width, do not use brushes. Use the pencil tool and a simple blow

    If you apply a calligraphy brush, apply the effect zig - zag to it with a value of 0, then a setting of about 100 (turn on the preview to adjust)

  • Problem with Textfield autocomplete--&gt; only use the INSTR function

    Hello team dev,

    I use the new "textfield autocomplete" item type APEX and you have a crazy problem with it.

    I have a table with an index on the same column I want to search with AutoComplete field.

    Index:
    CREATE BITMAP INDEX TEST.GEO_DATA_IDX1 ON TEST.GEO_DATA (postcode)
    NOLOGGING TABLESPACE TS_INDEX;
    Select which is automatically generated by APEX 4:
    SELECT   a.*
      FROM   (  SELECT   DISTINCT postcode AS RV
                  FROM   TEST.GEO_DATA
                 WHERE   country_id = :P1_COUNTRY
              ORDER BY   1) a
     WHERE   INSTR ("RV", :p$_search_string) > 0 AND ROWNUM <= :p$_max_rows;
    
    -- plan
    Plan
    SELECT STATEMENT  ALL_ROWSCost: 4,308  Bytes: 45,31  Cardinality: 1,97            
         2 SORT UNIQUE  Cost: 4,307  Bytes: 45,31  Cardinality: 1,97       
              1 TABLE ACCESS FULL TABLE #TABLE# Cost: 4,306  Bytes: 47,311  Cardinality: 2,057  
    The APEX 3, I used the addon of Tyler Muth with my own Select:
    SELECT   DISTINCT
                postcode AS DV,
                postcode AS RV
         FROM   TEST.GEO_DATA
         WHERE   country_id = L_COUNTRY
         AND    postcode like l_search||'%'
         ORDER BY 1
    
    -- Plan
    SELECT STATEMENT  ALL_ROWSCost: 840  Bytes: 152,867  Cardinality: 13,897                                
         8 SORT ORDER BY  Cost: 840  Bytes: 152,867  Cardinality: 13,897                           
              7 HASH UNIQUE  Cost: 838  Bytes: 152,867  Cardinality: 13,897                      
                   6 VIEW VIEW index$_join$_001 Cost: 836  Bytes: 232,111  Cardinality: 21,101                 
                        5 HASH JOIN            
                             2 BITMAP CONVERSION TO ROWIDS  Cost: 31  Bytes: 232,111  Cardinality: 21,101       
                                  1 BITMAP INDEX RANGE SCAN INDEX (BITMAP) #INDEX#
                             4 BITMAP CONVERSION TO ROWIDS  Cost: 45  Bytes: 232,111  Cardinality: 21,101       
                                  3 BITMAP INDEX SINGLE VALUE INDEX (BITMAP) #INDEX#
    Is there a chance to get my INDEX used by the new element of the APEX? I do not. But I still want to ask before I just rebuild. :)

    Best regards

    Tobias

    Hi Tobias,.

    I guess that you are currently using "contains and case sensitivity ' to the attribute of"search ". Have you ever tried out "Exact and case sensitivity? Because that internally uses the LIKE operator as does your original query and the % is at the end, she must allow the use of an index. But it might still work, because ORDER BY can be run at a different time in your original example, but it's worth a try.

    Concerning
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Problem with burning a DVD using the AVCHD format

    I just finished on a video project of 19 minutes (photos and short video clips), and I was able to burn it to a DVD in standard quality with first Elements 10.  When I try to burn AVCHD, however, I get an error just until it's ready to start burning.  It encodes all media and all switches to the menu burn when the "error" appears.  There is no other explanation.  I also tried to burn to a folder and I get the same result.

    I used the first items 10 for 4 years to do this same type of project, and I was able to burn on AVCHD successfully in the past.  Any ideas why it doesn't work anymore?

    Specifications of the computer: desktop computer Dell Inspiron 3847, processor i5 12 GB of RAM, 1 TB hard drive w / 770 GB free.

    I appreciate all help.

    A.T. - I finally thought to it.  After I had removed 3 of 4 songs and their respective video clips / photos in the problem project, I took a thorough review to the media with the rest one song left to see if there was something unique about.  As I mentioned earlier, I had all the different file types in the project problem included in the test project, and the test project had burned successfully to AVCHD.  After having scoured what was left of my files, I found a picture that I had used the effect of the "line of demarcation" (edit - effects - line drawing).  I decided to remove the effect to see what would happen.  Once I did, I was able to burn this new project to test a DVD AVCHD (a value of 1 only one song from the media).  I then made the same change to my complete project and then it worked.

    Very frustrating, but I'm very happy that I found the culprit.  I note that I used a couple of the photo / video effects projects successfully, but never this 'dividing line' a before.  I would warn anyone against using it now!

    In response to a recent question, I was not able to burn a folder when I had this problem either (4.7 GB).

    Thanks again for your help.  I really appreciate that people are available to help solve the problems of this kind.

    Happy holidays!

  • Problem with a script post-porn the subform

    Hello

    I have a form with radio 5 buttons. Two of the radio buttons, the values 3 and 5 must make visible hidden subform. All other values are leaving the hidden subform. Here is my script:

    If (this.rawValue == '1') {}

    Page1.deliveryInformation.flowed.presence = 'hidden ';
    }
    If (this.rawValue == '2') {}

    Page1.deliveryInformation.flowed.presence = 'hidden ';
    }
    If (this.rawValue == '3') {}

    Page1.deliveryInformation.flowed.presence = "visible";
    }

    If (this.rawValue == '4') {}

    Page1.deliveryInformation.flowed.presence = 'hidden ';
    }

    If (this.rawValue == '5') {}

    Page1.deliveryInformation.flowed.presence = "visible";
    }

    else {}

    Page1.deliveryInformation.flowed.presence = 'hidden ';
    }

    Value 3 does not work. All other values are working as expected. I've been watching this script on over an hour and does not know why it does not work. Any help would be appreciated.

    Thank you

    MDawn

    The problem is with the last part else.

    Either place the conditions in

    If() {}

    }

    {ElseIf()}

    }

    else {}

    }

    OR

    Use the switch as a box below.

    Switch (this.rawValue)

    {

    case '1 ':

    Page1.deliveryInformation.flowed.presence = 'hidden ';

    break;

    case '2 ':

    Page1.deliveryInformation.flowed.presence = 'hidden ';

    break;

    case '3 ':

    Page1.deliveryInformation.flowed.presence = "visible";

    break;

    case '4 ':

    Page1.deliveryInformation.flowed.presence = 'hidden ';

    break;

    case "5":

    Page1.deliveryInformation.flowed.presence = "visible";

    break;

    by default:

    Page1.deliveryInformation.flowed.presence = 'hidden ';

    }

    Thank you

    Srini

  • JDeveloper 12.1.2 has a problem with links when you use the data bean control

    Build JDEVADF_12.1.2.0.0_GENERIC_130608.2330.6668

    The problem that I am facing is:

    I used the data bean control to create our user interface. After that I dragged my jsff page data control, links have been created.

    I opened the XML pagedef to my page. On the Bindings tab and executable, I added a few links more by clicking on the Green plus sign. After I saved my changes, I noticed that some other links have been replaced by a link to the different executable files.

    This behavior occurs almost everytime I have edit links. Does anyone else see this problem?

    It looks like another instance of the bug described in https://java.net/jira/browse/ADFEMG-156

    This bug is fixed in 12.1.3. If you need the fix in 12.1.2 you should open a SR with support.oracle.com and ask a backport.

    Timo

  • Problems with Weaver of dreams using the creative cloud

    Hello

    I downloaded the creative cloud in order to to use the Weaver of dreams (for my college

    class). I have no knowledge on this program, I watched the tutorials on

    the adobe and of course YouTube Web site. Everytime I open CC and attempt

    to open the app to Dream Weaver... it does work for me. I did something

    bad, do I need special software? I need all the help I can get with

    This thing, thank you very much!

    Jessica Reed

    If you try to open the DW of the CC desktop app, that will not work. The application of CC desktop is only for download, install and update the program (and a few extras).

    You will need access to your Applications (Mac) folder or in your Program Files (x 86) (PC) folder, and then to Adobe > Dreamweaver (your version) to find your actual application file. Create a shortcut or alias on your desktop to this file for future use.

  • Problem with update of table (using the subquery to retrieve value)

    Hello
    I update a table based on the value of the subquery.
    Here's the update statement.

    UPDATING temp xm
    SET xm.col1 = (SELECT DISTINCT col1
    Of
    (SELECT col1, col2 COUNT (col2)
    FROM table2
    WHERE col1 = xm.col1
    AND col2 = xm.col2
    GROUP BY col1)
    where col2 in (select... in the table3)
    )
    WHERE xm.col5 = < value >
    AND xm.col6 = < value >

    When I run this statement I get following error.
    ORA-00904: "XM". "" Col1 ": invalid identifier.

    Can someone help me why I get this error?
    Why doesn't the main table alias in the subquery?

    Is it possible to avoid this / re - write the query in a different way?

    Thank you

    Published by: user552703 on November 2, 2009 20:42

    You can nest only 1 level deep (referring to the table to be updated).

    Have you looked at using the MERGE command? It is "easier" perform updates of this nature, assuming you are using a recent version of Oracle (9 or MORE).

  • Problem with a script embedded in the pane with Photoshop CS6

    Hello

    I rebuild one of my Panel for CS6 to publish in Agora, but I have a big problem.

    I have 'export (ed) my Panel as a CS extension'., have installed the ZXP file but I can't find the Panel in the subfolder... / Plugins/panels.

    The problem is that I have incorporated a script in my control panel to open files located in the 'configuratorpanel.assets '. It does not work because the files are not in the same place as a normal export.

    Here is the example of my code to understand:

    "

    //---------------------------------------------------

    Localized path to the plug-ins folder

    //---------------------------------------------------/

    var strPlugInsFolderDirectory = locate ('e $$$/LocalizedFilenames.xml/SourceDirectoryName/id/Extras/[LOCALE]/[LOCALE]_Plug-ins/valu plugins =");

    //---------------------------------------------------

    Open the directory from the Collections of edges

    var strEdgeFXFolder = Folder (app.path.toString () + "/" + strPlugInsFolderDirectory + "/ Panels/edgeFX/Content/edgeFX.assets/Edges%20Collections/");

    var edgeFXFile = strEdgeFXFolder .openDlg ("Choose the egde to apply", "JPEG/PNG: * JPG;") *. JPEG; *. JPE; *. PNG');

    Open (edgeFXFile).

    Thanks a lot for your help.

    Sébastien

    Please find the 'active' to the directory folder when using 'File-> export as Extension CS' and install the zxp by the extension manager:

    Mac: / Library/Application Support/Adobe/CS6ServiceManager/extensions /.

    Windows: C:\Program Files (x 86) \Common Files\Adobe\CS6ServiceManager\extensions

    Xiaoyan

  • Is there a problem with Adobe Reader DC using the command line to open a file?

    Hello

    I am a developer and we use Adobe Reader to view our PDF help files in our application.  For years, we used WinExec() to open Adobe Reader, by specifying the file to open on the command line and it has been working perfectly.  In other words, upward until our users began to load Adobe Acrobat Reader DC.  Despite this work very well when you type a command using CMD.exe, it simply does not help WinExec() from another application programmatically.  Also, I modified the code to try using CreateProcess() or ShellExecute() and these functions do not work either.

    It may have to do with the fact that there is a switch or a parameter now within the DC, but I don't know what it is, or why it happens.  If anyone can shed some light on this it would be much appreciated because it severely hampers our latest version of the software.

    Kind regards

    Leigh.

    A common cause is not to put quotes on the command line, so instead of

    "c:\program files...\acrord32.exe" "c:\documents and settings\...my file.pdf.

    You write

    "c:\program files...\acrord32.exe" c:\documents and settings\...my file.PDF

    This has always been bad, but older versions it would accept anyway. (It was a recent change but not in DC).

    I would recommend using ShellExecute instead of the command line, however. That simulates a double-click and executes everything the user has created for PDFs (perhaps Reader, Acrobat maybe, maybe something else).

  • I can't use the get-vdswitch cmdlet powercli

    Hey, guys:

    When I finished installing the powercli, I can use a cmdlet powercli, but when I want to get the information of VDS, FDI noticed that «the term 'get-vdswitch' is not recognized as a cmdlet, function, file, or operaable script program» \

    can someone thell me what wrroy thereon.

    THX.

    What this does?

    Get-PSSnapin-name VMware * | Select name

  • I had a problem with slow, so I used "reset". The popup ran forever so I stopped it. Now I can not remove or add the program.

    I had a problem with slow, so I used "reset". The popup ran forever so I stopped it. Now I can not use, remove or add the program. How should I proceed?

    TIA,
    BWSwede

    Try to create a new profile.

    See "create a profile":

    If the new profile works then you can transfer files from a profile in the new profile, but make sure not to copy corrupted files.

    What problems do you have that you want to reset Firefox?

    Firefox creates a new folder of old data of Firefox on the desktop?

    If reset you Firefox and a new profile is created and some of your data (bookmarks, passwords, cookies, form data) is automatically imported and your current profile will be moved on the desktop (old data of Firefox).

  • my computer recently crashed and when I tried to use photoshop, then I got the message: - message - problem with display driver, temporarily disabled the improvements. Does that mean, they will return when the problem is solved?

    My computer recently crashed. A fixed it but! When I then tried to use photoshop I got the message: - message - problem with display driver, temporarily disabled the improvements. Does that mean, they will return when the problem is solved?

    Update or restore your graphics driver.

  • I had problems with access to most of the Web sites and I noticed that HTTPS is no longer, how do I make permanent HTTPS so I can access any Web site?

    I had problems with access to most of the Web sites and noticed that HTTPS no longer appears whenever I try to access a Web site. I can easily connect to my gmail and facebook account, but the problem is that when I click on a link on FB and gmail, I get the annoying message "refused to connect.

    How to address this issue, rather how to make HTTPS permanent so I can easily access any Web site. The date and time on my laptop are both correct. I am currently using OS x 10.9.5.Please!

    How to address this issue, rather how to make HTTPS permanent so I can easily access any Web site.

    My guess is that you have a damaged or invalid certificate entry OS X KeyChain, but to directly answer this question, I would say that consider you something like HTTPS Everywhere. Note, it is not available for Safari. It is available directly through the Google Chrome browser extensions.

Maybe you are looking for

  • YouTube load black screen for the first five seconds

    As of the beginning of January 2013 in Firefox, videos YouTube are responsible as empty black screens for the first five seconds. 0:06 mark, video begin to play normally. This isn't a problem in Chrome or IE. Tested with all plug-ins and Add-ons disa

  • Satellite L300-129 - how to increase the video memory (shared)

    Yesterday I bought TOSHIBA Satellite L300-129 AND I WANT TO ASK SOMETHING: I want to share some memory to improve the proceedings of VGA card.I know that I need to do from the CONFIGURATION of the BACK but I can't and I need to improve my VGA card be

  • Satellite P200-1EE connected to LCD TV via HDMI

    I recently bought an HDTV (Sony v3000) with the intention of watching my HD-DVD on the big screen! When I log in and watch, my TV tells me that the signal is only 1080i when my TV is 1080 p. What should I do to make sure my HD-DVD is monitored at the

  • Satellite L300 - display turns off

    My Satellite L300 was working properly then the view is empty. I tried to reboot and the screen turns off after 1 second, I plugged a monitor and that works, but nothing on the laptop. But when I unplug the monitor, the computer screen turns on for 1

  • Upgrade of Windows 10 works not

    Hello I am trying to upgrade my PC Windows 7 (Windows 7 Professional 64-bit) Windows 10, using the application "Get Windows 10. I tried following the instructions of the app, but each time when I click on "Update now", the computer just makes a stop