Array for if loop

Welcome Forums General PowerShell Q&A Array for if loop

This topic contains 1 reply, has 2 voices, and was last updated by

1 year, 7 months ago.

  • Author
  • #74491

    Points: 0
    Rank: Member

    Hi Guys

    Does anyone have an example where I can iterate through an array using a for or for if loop?

    Would like to use this to generate automated emails.


  • #74492

    Points: 1,811
    Helping HandTeam Member
    Rank: Community Hero

    You want a ForEach loop.

    ForEach ($item in $array) {
    # variable $item contains one thing from $array

    PowerShell does not have a "for if" loop. Run "help about_foreach" in the shell for more.

The topic ‘Array for if loop’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort