title: Filling up property value in array from already having a range of values - PowerShell
body: <p>$emails = Import-Csv "C:\Testing\Emails.csv"</p>
  
  <p><strong>$emails</strong></p>
  
  <p><code>Email
  </code>
  <code>User-1@test.com
  </code>
  <code>User-2@test.com
  </code>
  <code>User-3@test.com
  </code>
  <code>User-4@test.com
  </code>
  <code>User-5@test.com
  </code>
  <code>User-6@test.com
  </code>
  <code>User-7@test.com
  </code>
  <code>User-8@test.com
  </code>
  <code>User-9@test.com
  </code>
  <code>User-10@test.com
  </code>
  <code>.... and So on...
  </code></p>
  
  <p><strong>$DagSelection</strong>
  <code>
  DAGname Sr
  </code>
  <code>GB-01 1
  </code>
  <code>GB-04 2
  </code>
  <code>GB-02 3
  </code>
  <code>GB-03 4
  </code></p>
  
  <pre><code>$DagValues = $DagSelection.dagname
  [PSCustomObject]$Array1 = @()
  foreach ($x in $DagValues) {$Array1 += 1..100 | foreach {[PsCustomObject] 
  @{Databases= $x + "-" + "{0:D3}" -f [int]$_}} }
  </code></pre>
  
  <p><strong>$Array1</strong>
  <code>
  Databases
  </code>
  <code>GB-01-001
  </code>
  <code>GB-01-002
  </code>
  <code>GB-01-003
  </code>
  <code>GB-01-004
  </code>
  <code>GB-01-005
  </code>
  <code>.... and So on...
  </code></p>
  
  <p>My Problem is here with the code given below. It fills up the Databases for each email address given in column Email. But, not in loop. cause the range got finished and what i want is to fill it until we have email address in place. That means if range is GB-01-001 to GB-01-100 it should start again from the beginning. Hope I have covered requirement here. Please let me know if any queries.</p>
  
  <pre><code>$props = $Array1 | Get-Member -MemberType NoteProperty | select -ExpandProperty Name
  foreach ($prop in $props){$emailsTemp | Add-Member -Name $prop -Value $null -MemberType NoteProperty -Force}
  for ($i=0;$i -lt $emailsTemp.count; $i ++){ $emailsTemp[$i].Databases = 
  $Array1[$i].Databases}
  $emailsTemp
  </code></pre>
  
  <p><strong>$emailsTemp</strong></p>
  
  <p>Email                  Testing<br>
  <code>User-1@test.com  GB-01-001
  </code>
  <code>User-2@test.com  GB-01-002
  </code>
  <code>User-3@test.com  GB-01-003
  </code>
  <code>User-4@test.com  GB-01-004
  </code>
  <code>User-5@test.com  GB-01-005
  </code>
  <code>User-6@test.com  GB-01-006
  </code>
  <code>User-7@test.com  GB-01-007
  </code>
  <code>User-8@test.com  GB-01-008
  </code>
  <code>User-9@test.com  GB-01-009
  </code>
  <code>User-10@test.com GB-01-010
  </code>
  <code>......
  </code>
  <code>User-401@test.com (I want to fill up here as well)
  </code>
  <code>User-402@test.com (I want to fill up here as well)
  </code>
  <code>User-403@test.com (I want to fill up here as well)
  </code>
  `........ and so on... Until Email Ids are present in first column named <strong>Email</strong>.</p>