Using 'or' in a loop

Get stumped on this one and looking for any help.  This snippet of a script basically comes right after adding hosts again in a cluster.  It checks to make sure that guests are connected before proceeding.  It has been working fine until we hit a cluster with a host in maintenance mode .  Come in white on how to add maybe one or a statement that would allow me to include as a State maintenance mode.  Any contribution is appreciated.

#Importing host information collected earlier csv

$CSVhosts = import-Csv.\VMHost.csv

#Checking that the hosts are connected before proceeding

{foreach ($vmhost to $CSVhosts)

{}

[string] $status = (get-vmhost-name $vmhost.name | select ConnectionState)

Write-Host "connection status of" $vmhost.name "="$status"'-process will run when the status of the host is connected" "

Start-Sleep - seconds 1

}

While ($status - don't ' @{ConnectionState = connected} ")

}

With the help of one or one in all in State would work, but you also use a table of the status of the target and use the operator of notcontains.

Something like this for example

$waitForThese = 'Connected', 'Maintenance '.

#Imporing host information collected earlier csv

$CSVhosts = import-Csv.\VMHost.csv

#Checking that the hosts are connected before proceeding

{foreach ($vmhost to $CSVhosts)

{}

$status = get-VMHost-name $vmhost.name | Select the ConnectionState - ExpandProperty

Write-Output "connection status of the $($vmhost.name) = $status - process will run when the status of the host is connected.

Start-Sleep - seconds 1

}

While ($waitForThese - notcontains $status)

}

Tags: VMware

Similar Questions

  • If I use a single individual loop for my video and upload it to youtube will be my video will be blocked or will I get copy right strike?

    If I use a single individual loop for my video and upload it to youtube will be my video will be blocked or will I get copy right strike?

    I already read the agreements loops but unable to understand exactly what it means please help me...

    They say individual loops must not be commercialy or other wise distributed...

    That means individual loop should not be used?

    Is the only thing you can NOT do: "Yes, I did these loops and now I'm selling you these loops, claiming that I just them

    So they are free, but you are not allowed to sell unaltered loops claiming that make them you. So you can use them for any kind of music, published published, obscure, commercial, anything; without additional costs or restrictions.

    Hello... Please help me I want to just use a single loop of logic pro X for my video and want to download YouTube wil...

  • I need to use programming like ActionScript loop, trigger, and load the data in the movies.  I can do with AE?

    I have been producing auto generate and parameter based animations for an artist over the years using Flash.

    Like this: Zarah Hussain | Animation

    Someone asks now that we use After Effects, but I need to use programming like ActionScript loop, trigger and load data into the movies.

    I can do with AE?  We need the loading animation 3 data values that affect the colors in real time

    Is it: -.

    Flash = online and interactive

    AR = fixed and linear.

    Help!

    Cries.

    You cannot use AE for this kind of things. Outside very limited real-time EI functionality it has not yet officially a dynamic performance of preload beyond the evalFile() hack. None of this makes no sense at all.

    Mylenium

  • When to use the cursor for loop and the cursor (open, fetch, close)

    Hello world
    I have a small doubt about when to use the cursor for loop and when to use the cursor for loop and the cursor (open, fetch, close).
    Well, I'm not the difference between implicit and explicit cursor. So please tell me how I got to know, what to use and when?




    Kind regards
    BS2012

    Published by: BS2012 on January 29, 2013 12:15

    All SQLs are analyzed, stored and executed as cursors. Thus, you will always use a cursor.

    The problem is that languages, such as PL/SQL, provide different interfaces to interact with the SQL cursor. As the ref, the slider interface, the interface DBMS_SQL slider interface and so on.

    Each of these interfaces offers different features. For example, using the interface DBMS_SQL allows binding dynamics and dynamic recovery. The Ref Cursor interface allows your code PL/SQL pass a handle to a reference pointing to the SQL cursor, to an external client. Etc.

    The fundamental reason for the use of an explicit cursor interface is mainly that you own and manage bulk made extraction output provided by PL/SQL cursor.

    With a cursor FOR , the motor loop of PL/SQL optimize the loop by extracting block a 100 lines both. However, you cannot access this collection in bulk directly inside the loop.

    With an explicit cursor interface, you specify the size of the extraction in bulk via the clause LIMIT , and you set the variable of collection to use. This allows you to use the collection directly variable inside the loop.

    However, the need to do - code manually in bulk collection - rarely occur in the daily programs in PL/SQL. A line of treatment is both slow and not well fits. And even if your bulk code collects lines, these lines must still be processed one at a time in your code. It is much more efficient and scalable rather write SQL code, and make the engine SQL the line of treatment for you.

  • I want to use for the next loop to reduce the code to make of removechild)

    I work if (addChild (bmp1)) - removeChild (bmp1). But I need to do it 20 times. I thought I could use a for/next loop, but this day can't do things.

    for (var i: Number = 0; i < 21;) I ++)

    {

    my_bmp. Name = "bmp" + 1;

    If (addChild (my_bmp))

    {

    removeChild (my_bmp);

    }

    }

    }

    This code from the compiler, but when I run it I get "a term is undefined and has no properties." I think it has something to do with my_bmp.name? I tried several things and just cannot break.

    The name of an object is just a string.  for the compiler to treat it as an object, you can use the getChildByName() method or even the support rating.

    removeChild (this.getChildByname (my_bmp));

    OR

    removeChild (this [my_bmp]);

    I'm guessing that you intend to use "bmp" + String (i) instead of "bmp" + 1

  • using 'next' in a loop for?

    Hello!

    can you just explain in an example how to use 'next' in the loop 'for '? I think that's exactly what I need, but I can't find examples of how to use it.

    TKS. O

    Just write the line of code below the for loop

    for (var I...) {

    No matter what

    }

    var instance: ClassName = new ClassName()

  • Procedure cannot be updated by using the cursor and loop

    Hi all

    I am creating the procedure below to update some columns, but when I try to start nothing happens, what I want, is that some data in table2 are updated.

    Help, please. Thank you.

       v_from            NVARCHAR2 (30);
       v_to              NVARCHAR2 (30);
       v_date            DATE;
       v_id         INT;
       v_id1        INT;
       v_id2        INT;
       
    CURSOR cur_a is
        SELECT from, to, startdt, pid FROM table1
            WHERE rownum <= 100
            ORDER BY startdt;
    
    
    BEGIN
    
    
    OPEN cur_a;
    
    
    LOOP
    
    
    FETCH cur_a into v_from, v_to, v_date, v_id;
    
    
    EXIT WHEN cur_a%NOTFOUND;
    
    
    BEGIN
    SELECT pid 
    INTO v_id1
    FROM
        (
            SELECT pid FROM table2
            WHERE (from = v_from OR to = v_from)
            AND startdt < v_date
            ORDER BY startdt DESC
        )
        WHERE rownum = 1;
    EXCEPTION
          WHEN no_data_found 
          THEN
            v_id1 := null;
    END;
    
    
    BEGIN
    SELECT pid
    INTO v_id2
    FROM
        (
            SELECT pid FROM table2
            WHERE (from = v_to OR to = v_to)
            AND startdt < v_date
            ORDER BY startdt DESC
        )
        WHERE rownum = 1;
    EXCEPTION
          WHEN no_data_found 
          THEN
            v_id2 := null;
    END;
        
    UPDATE table2
    SET trx1 = v_id1, trx2 = v_id2
    where pid = v_id;
    
    
    END LOOP;
    
    
    CLOSE cur_a;
    
    
    END;
    /
    

    You don't need a PL/SQL procedure to do this, you can do it in SQL:

    MERGE INTO table2 t2 USING

    (SELECT t1.pid,

    Max (TF. PID) KEEP (DENSE_RANK LAST ORDER BY tf.startdt) trx1,.

    Max (TT. PID) KEEP (DENSE_RANK LAST ORDER BY tt.startdt) trx2

    FROM table1 t1

    LEFT OUTER JOIN table2 tf

    WE (tf.from = t1.from OR tf.to = t1.from)

    AND tf.startdt<>

    LEFT OUTER JOIN table2 tt

    WE (tt.from = t1.to OR tt.to = t1.to)

    AND tt.startdt<>

    WHERE rownum<=>

    GROUP BY t1.pid) x

    WE (x.pid = t2.pid)

    WHEN MATCHED THEN UPDATE

    SET t2.trx1 = x.trx1,

    T2. TRX2 = x.trx2

  • How to increment the value by using "FORALL" instead of loop for

    declare

    VAR_TYP TYPE IS VARRAY (32767) OF VARCHAR2 (32767).

    V_DSH_CM_NUMBER VAR_TYP;
    V_DSH_DATE VAR_TYP;
    V_DSH_TIME VAR_TYP;

    V_DSD_CM_NUMBER VAR_TYP;
    V_PLU_CODE VAR_TYP;
    V_DSD_DATE VAR_TYP;
    V_str_id VAR_TYP;

    LN_ITM NUMBER: = 0;
    number of STR_ID: = 30001;

    CURSOR CUR_DBMG_SAL_HEAD
    IS
    SELECT DSH. CM_NUMBER, D_DSH_CM_DATE, D_DSH_CM_TIME
    OF DBMG_SAL_HEAD DSH
    WHERE ROWNUM < 6;

    BEGIN
    CUR_DBMG_SAL_HEAD OPEN;
    LOOP
    COLLECT FETCH CUR_DBMG_SAL_HEAD IN BULK
    BY V_DSH_CM_NUMBER,
    V_DSH_DATE,
    V_DSH_TIME;

    FOR indx IN V_DSH_CM_NUMBER. FIRST... V_DSH_CM_NUMBER. LAST
    LOOP
    SELECT CM_NUMBER, V_DSH_DATE, PLU_CODE (indx)
    TO COLLECT FEES IN BULK
    IN V_DSD_CM_NUMBER, V_PLU_CODE, V_DSD_DATE
    FROM DBMG_SAL_DETL DSD
    WHERE DSD. CM_NUMBER = V_DSH_CM_NUMBER (indx);

    -block1
    FORALL ind IN 1.V_DSD_CM_NUMBER. COUNTY
    INSERT INTO PC_ALL_TAB
    VALUES (V_DSH_CM_NUMBER (indx),
    V_DSD_DATE (IND),
    V_DSD_CM_NUMBER (IND),
    V_PLU_CODE (IND),
    LN_ITM,
    STR_ID
    );

    LN_ITM: = LN_ITM + 1;
    -block2

    END LOOP;

    WHEN THE OUTPUT CUR_DBMG_SAL_HEAD % NOTFOUND;
    END LOOP;

    commit;

    CLOSE CUR_DBMG_SAL_HEAD;
    DBMS_OUTPUT. PUT_LINE('COMPLETE..!');
    END;

    o/p:-SELECT DSH_CM_NUMBER, LN_ITM FROM PC_ALL_TAB;

    DSH_CM_NUMBER LN_ITM
    4177424 0
    4177422 1
    4177426 2
    4177426 2
    4177426 2
    4177425 3
    4177427 4
    4177427 4
    4177427 4

    I need result as below, for eachdsh_cm_number, I need incrementing value of ln_itm... but using 'FORALL '.

    DSH_CM_NUMBER LN_ITM
    4177424 0

    4177422 0

    4177426 0
    4177426 1
    4177426 2

    4177425 0

    4177427 0
    4177427 1
    4177427 2

    Hello

    Why not do it in single SQL?

    As far as I can decode what you want (you seem to have too many variables), you try to do something like:

    INSERT INTO pc_all_tab (dsh_cm_number,
                            dsd_date,
                            dsd_cm_number,
                            plu_code,
                            ln_itm,
                            str_id
                           )
      SELECT dsh.cm_number,
             dsh.d_dsh_cm_date,
             dsd.cm_number,
             dsd.plu_code,
             row_number () OVER (PARTITION BY dsh.cm_number ORDER BY NULL) - 1 AS ln_itm,
             '30001' str_id
      FROM   dbmg_sal_detl dsd, dbmg_sal_head dsh
      WHERE  dsd.cm_number(+) = dsh.cm_number
             AND ROWNUM < 6;
    

    Concerning
    Peter

  • Why used this simple while loop work?

    The main idea is to create a search feature on a form. I want to move to the next record, until I find what I'm looking for. Here is the code:

    These variables to get the numeric values of the NumericField5 and NumericField8. RawValue of NumericField5 will be below the NumericField8.

    strt var = NumericField5.rawValue;

    var end = NumericField8.rawValue;

    While variable rawValue strt is smaller that the variable end rawValue, move to the next record in the DataConnection.

    While (strt < end)

    {

    xfa.sourceSet.DataConnection.next ();

    STRT = NumericField5.rawValue;

    }

    When it works, evil created another loop of research when the variables range from end to beginning.
    I don't know why, acrobat crashes each time. Help, please!

    You can store the contents of the field before you enter the loop, then use a loop for wait until he changed. Then you would update the content stored with the new value so that the next time through await you on the right thing.

    Paul

  • Problems to use TimerEvent in While loop

    Hello

    I try to use a while loop a TimerEvent. In the example below, I created the function init should loop through values myArray, tracing of each value to every three seconds. It seems, however, that because I am incrementing the value currentNum outside the while loop (from the timerHandler function), the just loop continues to turn until the Flash no longer responds.

    var myArray:Array = new Array ("one", "two", "three", "four", "five");

    var currentNum:int;

    myTimer var = new Timer (3000, 1);

    function init (): void {}

    while (currentNum < myArray.length) {}

    trace (myArray [currentNum]);

    myTimer.addEventListener (TimerEvent.TIMER_COMPLETE, timerHandler);

    myTimer.start ();

    }

    }

    function timerHandler(e:TimerEvent):void {}

    currentNum += 1;

    }

    init();

    I wonder if what I try to do is just simply not possible or if I'm missing something.

    Thanks in advance for any thoughts on the issue.

    This loop will run at the speed of light of the processor.  Put the timer inside it will not slow down it.  Chances are that you do not want to use a loop of any kind other than that which is developed through the use of the timer and the single event handler function.  Maybe together the repeat of the timer value be based on the length of the array.

  • Using LoadVar in a loop for?

    I have a list of file names in a table pointing to files of data on my hard drive. I am using a loop for to extract each file name of the table sequentially and load the file into a new table for later use. I have an onLoad event handler check if each file has been loaded.

    Result: It seems that the loop goes through all the names of files, but only the last index gets loaded and pushed to the new array, i.e. all the new matrix indices contain the data since the last loaded file.

    Here is my code - someone ' can me idea as to what is wrong?

    Thanks, it works! (with minor modifications)

    * var loadContents = function() {.. otherwise he would not be executed when it is called.}
    * the pageCount value - 1. then the first post increment will set it to "0" to the first index in the array.
    * set the condition to get out of the routine for:
    If ((pageCount+1) == _global.moduleContents.length) {.. .to correct for pageCount use as an array index number so it will match the length of the array}

  • Using createTextField in a loop to create a table

    Hi, I was looking everywhere and through my book, trying to find a way to make a table of textfields. I have 3 tables that are received through a Pearl script and need to create a table to display the 3 tables. The size of the tables always varies the table must be able to adapt to the size.

    I was thinking something in the sense of

    This.createTextField("hello_txt",0,10,10,100,20) ("title_text", this.getNextHighestDepth (), 10, 10, 300, 100);
    title_text. Multiline = false;
    title_text.WordWrap = false;
    title_text. Text = title;
    title_text.setTextFormat (title_fmt);

    I tried to do inside loops using the number of the loop under the title of the textfield object when it was created, but then I can't find a way to reference and assign the .text.

    Any help would be great, or if there is a different command to use that would work better than createTextField, I'm still pretty new flash and actionscript.

    Thanks in advance.

    You can always just use a datagrid for this. It adds to the size of your file, but it also looks good, scrolls AND is sortable and resizable accepts arrays as dataproviders. That being said, you can reference your clip as follows:

  • Using Calc script if loop

    I have a few dimensions. Accounts, time store, product, IDNO...

    When we have the elements in the factory that we incur some costs called Mill costs that cannot be referenced by store and sold day so we put in any store and nodate. At the time it is sold, they must be moved to the store and the appropriate date. We get certain costs such as NetSales for this product with IDNO (manufacturer identification No.). Can I write a script like this

    Fix (@Children "IDNO", "FactoryCosts")
    If(TotalSale<0)
    CopyData storeA-> storeB
    ENDIF
    ENDFIX
    / * IDNO contains the manufacturer for each product identification number * /.

    I also have to transfer these costs if there is a transfer of a storeA to storeB another reason any. Basically, they are returned to the company so there is a negative sale and a separate Bill is generated and it is sold in a different store. The process must be automated and I cannot hardcode it.

    I need some kind of loop so that essbase can automatically reference the data with IDNO-> storeA to IDNO-> storeB.

    Please suggest a better way to do by using or by eliminating the loop to automatically move data

    Essbase don't usually need loop statements, you perform the calculation on a data set that would look at all the stores. If you're looking at individual stores adds @levmbrs ("stores", 0) to your tax fix (assuming that the shops is the name of the Dimension)

  • How to use visa write in loop for

    Hello

    I'm developing a measurement with labview system. I need to write the entry within the loop and then out of the loop he supposed to read the voltage level of the analog input pin. But the problem is, out of loop is 1 table D, so when I put the entry visa within the loop, exit loop wire VISA is also table 1 d. Please help me. Should I supposed to do?

    Change of your loops of connections to register and you don't build a table or errors or resources from visa.

    /Y

  • Cannot use Select inside the loop For inside the SCTL (FPGA) - Bug? An alternative?

    When I put a Select statement inside a loop in a loop of Timed Cycle in LabVIEW FPGA, I get the following error when I try to compile:

    "An internal software error occurred. Please contact National Instruments technical support on ni.com/support with the following information:

    Error-61003 occurred at

    Possible reasons:

    LabVIEW FPGA: you cannot include this function in a loop For when the loop is within a single cycle timed loop. »

    I didn't know that whatever it is documented that says that this is not allowed; is this a bug or am I missing some documents?

    The code that causes this error looks like this, inside a SCTL (ignore Boolean wire wandering behind the loop for)

    I came up with the code below instead, which compiles into one Cycle timed loop, but it is a bit ugly. Does anyone have a better suggestion?

    This issue is currently followed under the CAR # 592391. Please keep an eye on our patches and new versions as usual!

Maybe you are looking for

  • Mini 1101: fatal error HP Mini 1101

    When you start the computer, I have to enter a password, after 3 attempts failed is displayed: Password check failed Fatal error... System stopped. CNU9281908 What is perhaps the password? y at - it a default password set by the BIOS?' (Noticed CNU92

  • Someone uses another SMTP relay and then using my email address to send spam.

    Someone uses another SMTP relay and then using my email address to send spam. They have no access to my hotmail otherwise I see on sent items. I can see the SMTP server on the header. What should do? They send SPAM to some of my contacts.

  • Windows update error "windowsupdate_00000646".

    Dear YOU,. Then Yes. This error keeps popping up. windowsupdate_00000646 I searched google and seen a lot of shit still somewhat useful things. 1. I tried to download all updates that cannot be installed. IN CASE OF FAILURE. Among the updates told me

  • Aspire BIOS 1414WLMi

    Hi all I searched for weeks for an answer to this, but no luck.  So I hope that someone here will be able to help. I have an old 1414WLMi book sucks (since 2005).  He came out with BIOS version a 3, 06, and I've updated from 3 to 10. When I do a chec

  • Failure of the IPS

    Hi all I am facing a problem when the IPS fails the entire network behind it is not not accessible. so, how can I check capacity of box two 1-material bridging. 2-software workaround.