title: Change value of a psobject property
body: <p>I have an array full of psobjects. Now I want to change some properties in each of the objects in the array.</p>
  
  <p>My code:</p>
  
  <pre><code>[array] $objectArray = $null
  foreach ($row in $result) {
      $object = New-Object -TypeName PSObject
      $object | Add-Member -MemberType NoteProperty -Name "Classification" -Value $classification
      $object | Add-Member -MemberType NoteProperty -Name "Status" -Value $status
      $object | Add-Member -MemberType NoteProperty -Name "Priority" -Value $priority
      [array] $objectArray += $object
      Remove-Variable -Name object -ErrorAction SilentlyContinue
  }
  
  foreach ($co in $objectArray) {
      $oldStatus = $co.Status
      $oldPriority = $co.Priority
      $oldClassification = $co.Classification
  
      foreach ($uid in $resultUids.Tables[0]) {
          if ($oldStatus -eq $uid.status_i_d) {
              $co.Status = $uid.status_i_d
              Write-Host "status" $co.Status "uid" $uid.uid
          } elseif ($oldPriority -eq $uid.priority_i_d) {
              Write-Host "priority" $co.Priority "uid" $uid.uid
          } elseif($oldClassification -eq $uid.classification_i_d) {
              Write-Host "classification" $co.Classification "uid" $uid.uid
          }
      }
  }
  </code></pre>
  
  <p>The code above works, but I just don't know how to change the value of the property itself. I would like to replace the value of "Classification", "Status" and "Priority" with <code>$uid.uid</code>.</p>