I am running PS cmdlet get-customcmdlet which is generating following output
Name FreeSpaceGB
---- -----------
ABC-vol001 1,474.201
ABC-vol002 2,345.437
ABC-vol003 3,147.135
random-value 4,147.135
I want to capture 003 from the highest volume number ABC-vol003 I also want to ignore random-value and only want to consider the values which have vol in it
get-customcmdlet | select Name
Name
----
ABC-vol001
ABC-vol001
ABC-vol001
random-value
Here, I want 003 to be variable based upon highest volume number