need help foreach loop

looking to run a loop foreach with 2 variables here

$vmwareluns = get-content c:\netappluns.txt

$igroup = get-content c:\igroup.txt

{foreach ($lun to $vmwareluns)

Add-nalunmap $lun $igroup

}

but fails

do I need a second loop here?

each line in the Group must go with all lines in $lun

You can use the nested ForEach loops

$vmwareluns = get-content c:\netappluns.txt

$igroups = get-content c:\igroup.txt

{foreach ($group in $igroups)

{foreach ($lun to $vmwareluns)

Add-nalunmap $lun $igroup

}

}

Tags: VMware

Similar Questions

  • Need help with loops

    Hi all

    I am a beginner in Labview. If need help in loops. Please check the attached vi and suggest me the procedure I followed is effective or not. If this is not the case, correct me.

    Waiting for answer

    According to the commentary of diagram, table sizes are all 16, then here is everything you need:

    (Hmm, clips chiseled Booleans in the constant diagram, just ignore that)

    "Elements of an array AND" checks if all a real (upper thread)

    'The GOLD table elements' check if at least one is true. (all others)

  • Need help with loop removeChild! for (var i = 0; i < 10; i ++)

    Hello! Im working on a game project and having problem when a loop to add more enemys.
    What I want to do is like, so time exhaustion and player failing to the chassis, I want that child to get removed. but I can't access the var in the loop. I know it's an easy way...
    but wil be prefect if someon have any help.

    public void enemysLvl1() {}

    for (var i = 0; i < 10; i ++) {}

    var frukt1:Frukt = new Frukt;

    addChild (frukt1);

    }

    I am grateful for!

    Add every instance of frukt1 in a table, as Ned said, or make one enemy container - a Sprite and then only add enemies to the container. You can then he empty of any call removeChildAt (0) while container.numChildren > 0

    I tend to use Sprite containers a lot...

  • Need help with loop and variable

    Hi all.

    I'm almost there with this, but I'm stuck on one last question.

    I am a loop in XML to choose the images to display, with the title and ID (which is used in the link).
    Everything works now except the itemID. This used to work, but now the ID is the same for all containers/links on the page.

    Code is attached below, and the function is the image.addEventListener.
    The itemID variable is that doesn't change is not to reflect the individual elements.

    Please please help.

    Thank you very much


    Hello

    You can try to use logic you used in your posted previous sample. Use the event.currentTarget.id to get the ID of the Image.

    image.addEventListener (MouseEvent.CLICK, function(e:Event):void
    {
    var imgId:String = e.currentTarget.id;
    var url: URLRequest = new URLRequest (" http://localhost/youtubeDownloader-debug/index.cfm?video=" + imgID).
    navigateToURL (url, "_blank");

    });

    You can also use the property 'data' of the Image to store the value you want and use the same property to get the value in the event listener.

    I hope this helps.

  • Exclusion of a virtual machine foreach loop help

    I need to stop all the virtual machines in a particular vCenter due to work on the underlying storage.  I have a script that would normally do this, but in this case, the vCenter is virtual.  I need the foreach loop to ignore it.

    I thought I could do a nested loop, but my tests do not work...  Pointers or suggestions?

    Thanks in advance!

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

    SE connect-VIServer $server

    # Gets the list of all virtual machines in a specific folder

    $vms = get-data center-appoint "data CENTER" | Get - VM

    # Stop the virtual machines in the data center located in a State power.

    {Foreach ($vm to $vms)

    If ($vm. PowerState - eq 'Receptor') {}

    If {($vm.name-ne «vcenter01»)}

    $vmMOR = $vm | Get-View

    If {($vmMOR.Config.Tools.ToolsVersion-ne "0")}

    stop #gracefully

    Stop-VMGuest - VM $vm - confirm: $false

    sleep - 60 seconds

    }

    #forcefully VM stop

    Stop-VM - $vm VM - confirm: $false

    }

    }

    }

    sleep - 60 seconds

    Stop-VMGuest - VM vcenter01 - confirm: $false

    Try like this

    SE connect-VIServer $server

    # Gets the list of all virtual machines in a specific folder

    $vms = get-data center-appoint "data CENTER" | Get - VM |

    where {$_.} Name - not "vcenter01" - and $_. PowerState - eq "Receptor"}

    # Stop the virtual machines in the data center located in a State power.

    {Foreach ($vm to $vms)

    if($VM.) {ExtensionData.Config.Tools.ToolsVersion - only '0')}

    stop #gracefully

    Stop-VMGuest - VM $vm - confirm: $false

    sleep - 60 seconds

    }

    else {}

    #forcefully VM stop

    Stop-VM - $vm VM - confirm: $false

    }

    }

    sleep - 60 seconds

    Stop-VMGuest - VM vcenter01 - confirm: $false

  • Need help in a loop

    Hello everyone
    I need help with loop for
    in pl/sql, I see that we do have to give County loop increment for
    However if I want to increment suppose 2 so what to do
    I want to print an own of stars using the loop
    Like this
             *
          * * *
       * * * * *
     * * * * * * *
    However, I am able to print at a right angle triangle
    *
    **
    ***
    ****
    *****
    ******
    begin
    for i in 1..10
    loop
     for j in 1..i
      loop
     dbms_output.put('*');
     dbms_output.put(' ');
     end loop;
     dbms_output.put_line('');
     end loop;
     
        end ;
    Published by: Sara on November 22, 2010 03:28

    Published by: Sara on November 22, 2010 03:37

    Published by: Sara on November 22, 2010 03:37

    Published by: Sara on November 22, 2010 03:38
  • Need help with an Export-CSV and ForEach loop

    Hi guys, I'm total NOOB in CLI so please forgive the stupid question.

    I need your expert advice for the very large environment and will award points.

    I have a working script that alerts to our logout ESXi hosts, maintenance and NotResponidng mode

    His job well, but need to send a mail to all three of our VCenters

    Current script only works for a VC at a time. How do I ForEach and always the hose of the same body CSV and HTML

    It would be nice to have an HTML and CSV output that looks like this (assuming that there are currently disconnected etc.)

    I have a set of credentials, that work on all 3 of my VC

    VC1

    Host1 disconnected

    Host2 NotResponding

    VC2

    Host3 disconnected

    Host4 NotResponding

    VC3

    No disconnected/maintemance/notresponding hosts for VC3

    Here is my current code, etc. of the hidden passwords >

    # Clear old sessions
    Disconnect VIServer VC01-confirm: $false

    # VC01 VC check for disconnection and Maintenance mode and does not
    SE connect-VIServer-Server VC01 - FakeUSer username-password FakePassword

    $Report = get-VMhost-State disconnected, maintenance, NotResponding | SELECT name, connectionstate

    # scan info to be html and give him a date stamp

    $ReportHtml = $report | ConvertTo-Html | Out-string

    # Write CSV file and give it a character of data

    $filePath = "C:\PS\Output".
    $filename = "VC01disconnectedHosts".
    $CurrentDate = get-Date
    $CurrentDate = $CurrentDate.ToString ('MM-dd-yyyy_hh-mm-ss')

    $Report | Export-Csv "C:\PS\Output\VC_$Currentdate.csv".

    # Send the info by Mail

    Send-MailMessage-to [email protected] - subject VMwareMorningcheckVC01$ CurrentDate '
    SmtpServer - mail.sanlam.co.za - from [email protected] '
    -BodyAsHtml-body $reportHtml - accessories 'C:\PS\Output\VC_$CurrentDate.csv '.

    Thank you in advance for help.

    You could use a ForEach loop through all vCenters and combine the results in a $1 report.

    Something like that

    $vCenters = "VC01","VC02","VC03"
    
    # Clear old sessionsDisconnect-VIServer $vCenters -Confirm:$false
    
    $report = @()# Check VC VC01 for Disconnects and Maintenance mode and Not Respondingforeach($vc in $vCenters){  Connect-VIServer -Server $vc -User FakeUSer -Password FakePassword
    
      $Report += (Get-VMhost -State Disconnected,Maintenance,NotResponding | Select @{N="VC";E={$vc}},name ,connectionstate)  Disconnect-VIServer $vc -Confirm:$false}
    
    # parse info to be html ,and give it date stamp
    
    $ReportHtml = ($report | ConvertTo-Html | out-String)
    
    # Write out CSV file and give it a Data Stamp
    
    $CurrentDate = Get-Date -Format 'MM-dd-yyyy_hh-mm-ss'$filename = "C:\PS\Output\DisconnectedHosts-$($CurrentDate).csv"
    
    $Report | Export-Csv -Path $filename -NoTypeInformation -UseCulture
    
    # Send info with Mail
    
    Send-MailMessage -To [email protected] -Subject VMwareMorningcheck$CurrentDate `-SmtpServer mail.sanlam.co.za -From [email protected] `-BodyAsHtml -Body $reportHtml -Attachments "C:\PS\Output\DisconnectedHosts-$($CurrentDate).csv"
    

    I added the property vCenter for each line in the report

  • Need help of LabView on loops

    I'm doing a LabVIEW MyRIO project on how to display the values. Basically, I give myself a LCD screen and a keyboard. I'm supposed to show three sequences in the order. First, it must ask the user to enter a number on the keyboard to choose his field of interest. Then depending on the number, the user is prompted again to choose another number to specify the particular value he or she wants to watch. Finally, the value is displayed and the user can choose to return to the previous sequence interface by pressing a key. Each of the three sequences are able to "hold" until the user presses a button.

    I am able to attend the second interface using all loop inside a structure of the case, but I don't know how to start pressing a button to return to previous sequences. I need help on this particular part.

    Thanks in advance!

    The code that looks way too complicated for the problem you described.  Where is the state machine that we suggested to you?  Why so many useless people sequence structures?

  • Need help to identify the type of object in the loop of pl/sql

    Hello

    I need help to identify the Type of object declared beneath a procedure as shown below:

    I need to pass the parameter to the procedure as a TYPE of OBJECT and also refer to variables of Type Object in a loop

    create or replace type TEST_VALIDATION_REC is RECORD (order_num varchar2 (30),)

    number of inventory_item_id

    reserved_YN varchar2 (1).

    error_flag varchar2 (1).

    Error_message varchar2 (2000)

    );

    CREATE OR REPLACE TYPE VALD_TBL AS VARRAY (10000) OF TEST_VALIDATION_REC;

    PROCEDURE ADD_TO_ORD)

    p_lot_number_list IN VALD_TBL,

    p_ord_number IN Varchar2,

    p_user_id in NUMBER: = fnd_profile.value ('USER_ID'),-change 1.10

    p_responsibility_id in NUMBERS: = fnd_profile.value ('RESP_ID'),-change 1.10

    p_application_id IN VARCHAR2: = 'PO',-change 1.10

    x_error_flag OUT Varchar2,

    x_error_msg OUT Varchar2

    )

    In the above procedure, I had the VALD_TBL. Is it OK?

    And how in the loop if the records if I use:

    FOR indx1 IN 1.p_lot_number_list. COUNTY

    LOOP

    BEGIN

    SELECT

    inventory_item_id

    IN

    ln_item_id

    Of

    dummy_lot_tab

    WHERE

    lot_number = p_lot_number_list (indx1); - > how direct the item here?

    EXCEPTION

    WHILE OTHERS THEN

    ln_item_id: = NULL;

    END;

    Records are PL/SQL objects.  They are not the SQL objects.  You can create a SQL TYPE (schema level) as a collection (variable-tables only, tables nested).

    So therefore your first statement is syntactically incorrect

    CREATE OR REPLACE TYPE TEST_VALIDATION_REC IS RECORD
    (order_num VARCHAR2(30),
    inventory_item_id NUMBER,
    reserved_YN VARCHAR2(1),
    error_flag VARCHAR2(1),
    Error_message VARCHAR2(2000)
    );
    

    You must put in an anonymous PL/SQL block or the stored procedure

    DECLARE
    
       TYPE test_validation_rec IS RECORD
       (
        order_num VARCHAR2(30),
        inventory_item_id NUMBER,
        reserved_YN VARCHAR2(1),
        error_flag VARCHAR2(1),
        error_message VARCHAR2(2000)
       );
    
       TYPE vald_tbl iS VARRAY(10000) OF test_validation_rec;
    
       lv_tbl vald_tbl;
    
    BEGIN
    
       lv_tbl := vald_tbl();
      -- insert your code here 
    
    END;
    
  • The product I bought doesn't work! I need help and I was stuck in your 'contact us loop' for the last few days and I'm frustrated. How can I contact you for help!

    The product I bought doesn't work! I need help and I was stuck in your 'contact us loop' for the last few days and I'm frustrated. How can I contact you for help!

    Probably the best place to start is the right forum for your product. This is the forum for Distiller Server, a product used by corporations long dead, and probably not what you have. If you can't find the right forum, please let us know the FULL name of what you paid for (Please check your invoice, as Adobe have a lot of similar products), and we may be able to direct you. Good luck!

  • Need help with network home using Airport extreme

    I need help with my home network.  I'm not very aware when it comes to all things network.  Here's how my network is currently set up.

    Cable modem to Airport Extreme for Gigabit Switch.  Cables come out of the switch to all areas of the House.  I have 2 other extreme airport connected in other rooms of the House directly on the wall that dates back to the switch.  I hope I am explaining that properly.

    My problem is that this seems to have caused some of my connections cable does not work.  When everything is configured, it has worked well.  All connections in the House worked.  Then we have disconnected one of the extreme airport and moved to another location in the House to have the best wifi coverage.  Since that time, a lot of the ethernet wall plugs are not working.  For example, when I plug in my Macbook Pro in making ethernet in my kitchen, it says connected but it has an assigned ip address and cannot connect to the internet.

    Any help you can provide would be great.

    I would like to get the return tech to help you to...

    But it is likely that something (or someone) has tampered with the settings.

    The layout is fine... but you can cause problems with the network by creating a loop.

    This can happen because the AE you moved is connected wrongly... somewhere in the network it is connected to the switch again.

    Or AE is set to expand wireless... It's FAKE... It will loop the network on the back main EI wireless.

    Unplug the two AE you have that function as extensions...

    Turning off everything else... then it works again...

    Do it in this order.

    Modem... Wait 2 min

    AE... Wait 2 min

    Switch.

    Now check that the network is working properly... power of customers in various locations and make sure everything is good.

    If so, then manually reset the two AE of factory and redo their installation.

  • Need help for reading in parallel on the same interface and writing XNET

    Hello. I need help to configure CAN interface to write and read from the same interface.

    I use NI PXI-8513/2. I use CAN1 as interface.

    My had TO send status messages CAN every 100ms. I have to read in order to return akntoowlege to keep DUT CAN interface happy and not make mistakes.

    So, I want to open Strim Session and readall frames in the loop. At the same time, I need to be able to write in a frame HAD at the time...

    I only need to read one picture at a time too, but since I know the ID, I can pull it from the stream.

    What I'm confusing all is how to put in place the same CAN1 interface to be able to write and read in parallel.

    I think I would get errors that interface is already in use.

    Since I'm new to CAN, I was read and write only when necessary. But, sometimes I was getting errors on my messages. Sometimes I get message, sometimes miss me. But, when I run CAN test criminal as sniffer he sends and written every time. I was told it's because it recognizes all messages.

    I opened to suggestions of how best to implement the interface.

    I guess I can use CAN2 and separator to work around this problem, but I would use an interface if possible.

    Thank you

    Hi Rus,

    The XNET hadrware takes care of most of the low level of detials for you. The reading and writing of the circuits are both connected to the bus at any time. When you write to the hardware it will try to put a frame on the bus at the first opportunity he can. If the frame loses arbitration material re - will attempt to send the frame up is successful. Reception equipment monitor activity on the bus, regardless of what it conveys. The material received will usually throw a framework that was sent by communication equipment, but there is an Echo property pass to circumvent this behavior too.

    Take a look at the example of the expedition: MAY-> NI - XNET-> Sessions-> multiple Sessions Intro-> CAN even exit entry framework Port unique Point.vi. Keep in mind that this example you will need to use a second CAN interface to recognize frames, it transmits. I would recoment against the example CAN output Frame Single Point which would mimic your ECU if you choose a type of cyclic frame running this example.

  • help with looping equation

    I'm really bad here with this (apparently) pretty simple problem of labview.  I have a set of equations that rely on the response of the other previous formula and so on.  I can do that easily enough in excel.  I tried to recreate this function in labview and were really struggling to make it work.  I tried to use while loops and for loops, I think that's what I have to do here, but I have a lot of success.  in any case, I've attached the worksheet with two formulas, a .png showing the relationship between the formulas in the worksheet and my .VI.  Thank you for your help in advance.

    You need both a loop and a shift register.

    Lynn

  • Need to view daq reads per second but only to record a reading every 10 minutes. I would also like to record the date and time, at the same pace. Need help

    Need to show daq reads per second, but only to record a reading every 10 minutes, need help

    You are also looking to taste to 1 Hz data acquisition?

    My approach would be to use the DAQ acquisition to time your loop display reading each acquisition, then use the loop counter to control the logic of your writing to file.  For 1 Hz and 10 minutes write I would use 'quotient and remainder' I / 600; If rest = 0, then write the data point.

    For the date and time, under Calendar palette use the time get in seconds food a DateTime Format to a string.

  • need help! brike S6000

    Hi every1 I have flashed my device and bad recovery image collapsed I tried to restart it I had meta and recovery mode, but the recovery screen shows these three operations: recovery, quick mode, normal mode by pressing any botton it hangs for minutes then don't reboot loop, no logo no sound screen led just empty my q is cannot I he unbrick bootable sd will do the job How? I have the stock firmware great need help please thank you

    Use this tool to install drivers for your tab. See here: -.
    http://Forum.xda-developers.com/showthread.php?t=1983470

    Using that you can install the drivers for any device. Now, I think you would be knowing how flash ROM flash SP tool. If this isn't the case, then after return.

Maybe you are looking for

  • Temporary access account blocked

    Hello Access to my account was temporary blocked because of some erroneous entries. How long is temporary?

  • Set the bar tab under the address bar; No options "Tabs above" not listed anywhere.

    There's no other choice "Tabs at the top". Tab Mix Plus move at the bottom of the view-port, but not in the address bar at the view port. Extremely awkward. makes navigation difficult and more difficult to locate the tabs, being further from the view

  • Portege R600 / A600 and double output screen

    Hello Could you tell me if it is possible to output to two screens on the R600 or A600 with any of the Toshiba Docking solutions? I was told that it is possible, however I was told today by the sales of Tosh is not possible to do. I want to end my ho

  • M100: Wireless network in Asia hotels

    I have a problem with my Toshiba Portege M100: Normally when you want to use the wi - fi network in a hotel in Asia, you have to connect via a pop-up screen that appears automatically after activation of a wi - fi connection. For some reason, it does

  • RIO crashes when you use tcp communication and web server

    Hello my controller cRIO crashes after a short time (usually less than a minute), when I use simultaneously to the web server (to interact with a remote control) and make some tcp communication (using STM 2.0 library) for data logging. Is it a proble