I am using OpenShift CLI in a PowerShell Script,
I have a variable $ProjectList with Data. Not sure of its datatype, but doing $ProjectsList.GetType() gives me below
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True True Object[] System.Array
Looking for a way to Get Name field whose status is running
NAME READY STATUS AGE
Service One 0/1 Completed 13d
Service Two 0/1 Running 13d
Service 3 0/1 Running 13d
Service 4 0/1 Completed 13d
$ProjectList.Length
give me the value 5.
I am looking for a way to get the Name whole status is Running. Tried below code but it does not work.
$ProjectsList = c:\TEMP\oc.exe get pods
$FilteredList = $ProjectList.Where{ $_.STATUS -eq 'Running' }
write-host $FilteredList //This shows empty
Can you help me with some pseudo code.