How to copy text from PowerShell

powershell

Sometimes I want to copy a command from Powershell to paste in a document, or I want to copy the output? How can I select and copy text in Powershell?

At least I know a way how to paste a text (or a command) into Powershell: you just right-click on Powershell.

Best Answer

Just select the text in the console window and press enter or the right mouse button. That selected text ends up in your clipboard.

Note that this will only work if QuickEdit mode is enabled for the console window. If it is not, then either enable it in the console window properties (System menu → Properties → Options) or enter Mark mode via System menu → Edit → Mark (Alt+Space, E, K on an English Windows).