[cbt] C:\Users\TrevorSullivan\git> $PSVersionTable
Name Value
---- -----
PSVersion 7.0.3
PSEdition Core
GitCommitId 7.0.3
OS Microsoft Windows 10.0.19041
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0โฆ}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Windows Terminal 1.2.2234.0
$Person = @{
FirstName = 'Trevor'
LastName = 'Sullivan'
Likes = @(
'Bacon',
'Beer',
'Software'
)
}
This example fails as well:
@(
1
2
3
)
I can't be 100% sure, but it seems like maybe some "hidden" formatting from gist.github.com is causing this behavior? When I copied and pasted the examples using the GitHub issue editor (as I am authoring this), I can't reproduce it from here. ๐คท๐ปโโ๏ธ
The copied (unformatted) text is pasted precisely, character-for-character. The cursor position is at the end of the paste, so I can simply press ENTER to run the pasted command.
The text is being pasted incorrectly. It appears that the first and last line of the paste are actually being reversed.

Also if I hit ENTER to run the command, it gets mangled even further. I'm not sure if the cursor position is actually where it visually appears to be.

Thanks for the report! I think this is another instance of the problem in #5821, but I can't be sure. We end up sending the CR before the LF, and powershell reacts by moving to the beginning of the line:
2
3
becomes
|1
where the cursor is |
and then it inserts LF. PowerShell doesn't submit the command because pressing enter _anywhere but the end of the line_ actually allows a line break. Then it sends 2
2|
1
CR
|2
1
and so on.
Working on our pasting story is gonna help this out, so I'm going to roll this together with /dup #5821.
Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
(Also, that's a lovely color scheme. What is it?)
Alright, confirmed:

those are LFs!
@DHowett it's just the built-in One Half Dark color scheme. ๐ I created a PowerShell module that makes it easy to switch between color schemes, and in the future other settings.
Here's the video that shows the module in action (off-topic from OP)
Lovely! Thanks :D