The command works using the -Name too, as long as the variable is passed in correctly:
PS> $vmName="myVM"
PS> get-xenvm -name $vmName | select HVM_boot_params
HVM_boot_params
---------------
{[order, cd], [firmware, uefi]}
PS> $HVMBootParams = @{ "firmware" = "bios";"order" = "n"}
PS> set-xenvm -name $vmName -HVMBootParams $HVMBootParams
PS> get-xenvm -name $vmName | select HVM_boot_params
HVM_boot_params
---------------
{[order, n], [firmware, bios]}