比较 4 个变量(整数)并找到最大的数字

Comparing 4 variables (integers) & find the biggest number

检索 4 个变量中具有最大值的变量的最短且最简单的方法是什么?

$a = 24224243243434
$b = 12312343432323
$c = 31231243434342
$d = 24343543432421

最大值:

PS C:\> ($a,$b,$c,$d|Measure-Object -Maximum).Maximum
31231243434342

具有最大值的变量:

PS C:\> Get-Variable -Name a,b,c,d | Sort-Object -Property Value | Select -Last 1 -ExpandProperty Name
c

完整的变量名($):

PS C:\> '[=12=]' -f (Get-Variable -Name a,b,c,d | Sort-Object -Property Value | Select -Last 1 -ExpandProperty Name)
$c