Does it matter what the variable NAMES are? In other words, do you want all the variable names that begin with "val"?
Using the example you gave . . .
If you want only the variables whose name begins with "val", and only their VALUES and not the NAMES of the variables in the output, then this will work:
Get-Variable -Name val* |
Sort-Object Value,Name -Descending |
Select-Object -Expand value
If you want NAME and Value:
Get-Variable -Name val* |
Sort-Object Value,Name -Descending |
ForEach-Object{
"{0}`t{1}" -f $_.Name, $_.Value
}
Or this:
Get-Variable -Name val* |
Sort-Object Value,Name -Descending