Powershell: Pasting in reverse with right-click

Created on 18 May 2017  路  4Comments  路  Source: PowerShell/PowerShell

Steps to reproduce

Copy text with LF line endings and paste into console with right-click

Expected behavior

Text is pasted in its original order

Actual behavior

Text is pasted in reverse

Environment data

Windows 10 Enterprise 10.0.15063

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      5.1.15063.296
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.15063.296
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

image

image

I have been able to reproduce this on every machine I've tried on and it appears to exist in PowerShell v6.0.0-alpha.17 Release as well. This doesn't seem to happen with a ctrl+v paste.

Resolution-External WG-Interactive-PSReadLine

Most helpful comment

I see that the official issue now is https://github.com/PowerShell/PSReadLine/issues/579 and it is not fixed.

All 4 comments

I didn't get this to repro with beta1, but does repro with Windows PowerShell 5.1. At this time we're only taking critical security fixes for 5.1.

Was this ever actually fixed? I am on PowerShell 7.0.0 and still see this issue. In my scenario, I have some PowerShell scripts documented in Confluence as part of developer on-boarding. Confluence saves all documentation with LF and so when I paste a script from Confluence into PowerShell, it reverses the whole script.

In addition, I tried running Update-Module PSReadLine based on @lzybkr saying this is a PSReadLine issue, and I got the following error:

PS D:\Users\John.Zabroski> update-module PSReadLine
Update-Module: Module 'PSReadLine' was not installed by using Install-Module, so it cannot be updated.

I see that the official issue now is https://github.com/PowerShell/PSReadLine/issues/579 and it is not fixed.

Was this page helpful?
0 / 5 - 0 ratings