It looks like xp_cmdshell only uses the first line as the command to run.
I tried running a command using ^ (needed in the command prompt to split a command over multiple lines) and I still got nothing.
It does work if you concatenate it as one line in a local variable first, then call xp_cmdshell with the local variable.