Seems like your variables have newlines at the end.
You can try using Trim text on %Name% and %FileContents[0]% before putting them together.
Alternatively, you can use Replace text on %commend% after you have set it. You will need to enable regular expressions in Replace text to replace \n (which stands for newline) with %''% (this will replace it with nothing).
Finally, you could also use Split text to split it by newline as the delimiter, and then Join list on the output of Split text to join it again, using no delimiter.
Any of these ways are perfectly valid and should fix your problem. I'd go with trimming the variables first.
-------------------------------------------------------------------------
If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.
I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.