I think your Sort should say
$51hosts = Get-View -ViewType HostSystem -Filter @{"Summary.Config.Product.Version"="5.1.0"} |Sort-Object Name | Select -ExpandProperty Name
The separator should be a comma.
You can check by using the esxcli command, it will refuse the semi-column separated list