0

let's say that I have an array with differents values example : $myarray = @(1,2,35,4,5,6)

I simply want to have the greater value of $myarray; in the example the answer will be 35. I can't find if there is a cmdlet returning the greater value of an array.

Thanks in advance guys

1 Answer 1

1

Here's another similar question with an answer: Return object from array with highest value

And here's an example that should help as well: http://blogs.technet.com/b/heyscriptingguy/archive/2013/07/14/powertip-find-the-largest-number-in-a-powershell-array.aspx

PS C:> $a = [array]1,2,5,6,3,2,9,1

PS C:> $a | measure -Maximum

Count : 8

Average :

Sum :

Maximum : 9

Minimum :

Property :

Sign up to request clarification or add additional context in comments.

1 Comment

Happy to help! Please be so kind to vote up my answer and accept it, if you find it helpful. Thank you ! :)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.