How can I change audio output to HDMI from command line?

The OP posted the solution in his question:

While writing this I found the solution:

This command makes it easier to see what my actual output options are:

pacmd list-cards | grep output\:

That way of looking at the output of pacmd list-cards made me realize that the actual wording for my output is not output:hdmi-output but instead output:hdmi-stereo

This command is what worked for me:

pactl set-card-profile 0 output:hdmi-stereo

This is how I switched back to my laptop's internal speakers:

pactl set-card-profile 0 output:analog-stereo

This is how I changed the volume via command line:

amixer -D pulse sset Master 50%

This is just a smiley face:

:)