0

I'm new to Powershell. And I'm struggling with the most simplest of tasks.

OK. This is a really stupid question, but I have created a PSObject ... added members (4 columns, ID, Name, Status, TagFile; a number of rows) ... I have a loop ... for each i (iteration) ... I want it to use the values for the row in my object where ID = i.

It's really not hard. I have googled and haven't come up with an answer which is clear enough or concise enough to help me.

SuperSooty
  • 81
  • 4
  • 9
  • I am not sure if I have understood your question. If I am right, I understand that you want to store the value into the column. For that you may use $object_name.ID = i – Romaan Nov 05 '12 at 09:04
  • 1
    Add your actual code and an example of what you wnat to achieve. – CB. Nov 05 '12 at 09:14
  • Foolishly I am at work and my code is on my laptop at home. All I want to do is query my object. I want to find the row in my object where obj.ID = 1 etc. – SuperSooty Nov 05 '12 at 09:22

1 Answers1

1

this returns the row where the ID value is 1

$myPSObject | ? { $_.id -eq 1 }

From there you can tune the query based on your necessity

CB.
  • 58,865
  • 9
  • 159
  • 159