Powershell – Measure-Object is not exact because of rounding/flooring

In case you want to get maximal value without rounding/flooring – to be exact you should not use Measure-Object. You need to enumerate array (which is also faster).

Example:

Which is not what we wanted. For this we need to build own array and enumerate it:

Which results into:

Another method could be:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.