I've been using PowerShell on Windows 10 for some basic text editing and automation scripts. But on my new machine with Windows 11, every time I paste code into the terminal, it treats each line as a separate command, which is really frustrating since I can't seem to get anything to run properly. Does anyone know why this happens? These are work machines controlled by the admins, so I don't have the full details on how everything is set up. I thought PowerShell should work out of the box without issues. Thanks for any help!
4 Answers
You might want to install the psreadline module, as it helps with line editing and pasting issues. It's pretty handy!
Have you checked out PowerShell ISE? It usually comes with Windows and might handle pasting better than the regular terminal. You should definitely try it out!
Thanks! I noticed the terminal on Windows 10 had a blue background and colored text, while this one is black like CMD. Not sure if that matters.
Have you tried using CTRL+SHIFT+V to paste? It can help strip out any extra formatting and will paste just the plain text, which might solve your problem.
If you edit the Terminal settings json file and comment out a couple of lines, it might fix the issue. I can't remember exactly which lines, but a quick search online should help you find the right info.
Thank you, I will look into that!