There is a command which executes and give me the following output
Customer ID Client Name Computer Name Computer Brand
123 user1 127.0.0.1 lenovo
1 user2 127.0.0.2 apple
86 user3 127.0.0.1 dell
21 user4 127.0.0.4 apple
I want to get the Customer ID of users who use Computer Brand apple. The output should be as follows, so that I can do further operations on those ID's:
1
21
I tried to first select the users with 'apple' using the following:
$output | Select-String -pattern 'apple'
but then it will just print users with 'apple', but not the first row which makes it difficult for me to process further.
Update
I do not know if the following helps.
PS> $output.GetType();
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True True Object[] System.Array