Array for if loop

Tagged: ,

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of Don Jones Don Jones 2 weeks, 5 days ago.

  • Author
  • #74491
    Profile photo of steve rose
    steve rose

    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
    Profile photo of Don Jones
    Don Jones

    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.

You must be logged in to reply to this topic.