My team member was sharing the screen with me and granted control so that I can operate there. I had to copy a command from my local desktop into the console window of the shared screen. It looks like the clipboards do not work in harmony.
I had to first paste the same into the chat window and then take that from the shared screen chat window.
Most other screen sharing applications and/or conference tools support clipboard sharing. So I guess Teams should consider this as a Usability bug and need to fix it.