-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Resolution-FixedThe issue is fixed.The issue is fixed.
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
OS: Windows 10, Windows Server 2019
PowerShell Version: 7.2.2, 7.2.3
When outputting data to the clipboard, all color codes are captured as well. This makes it really inconvenient to use the clipboard as the contents are now mangled. These should be stripped when put in the clipboard as they have no use whatsoever as far as I can tell. This is just a simple example of it happening as it happens even when formatting text to be sent in an email (first place I noticed it).
Also Out-String shouldn't be needed either, but that's another ticket (#16431).
Get-PSDrive | Where-Object Name -ne 'Temp' | Select-Object Name, root | Out-String | Set-Clipboard
Then paste it back to notepad, pwsh, Word, or any other app (or at least I haven't found one it looks decent on).
Expected behavior
Name Root
---- ----
Alias
C C:\
Cert \
D D:\
Env
Function
HKCU HKEY_CURRENT_USER
HKLM HKEY_LOCAL_MACHINE
Variable
WSManActual behavior
�[32;1mName Root�[0m
�[32;1m---- ----�[0m
Alias
C C:\
Cert \
D D:\
Env
Function
HKCU HKEY_CURRENT_USER
HKLM HKEY_LOCAL_MACHINE
Variable
WSManError details
No response
Environment data
Name Value
---- -----
PSVersion 7.2.3
PSEdition Core
GitCommitId 7.2.3
OS Microsoft Windows 10.0.19044
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0Visuals
No response
Metadata
Metadata
Assignees
Labels
Resolution-FixedThe issue is fixed.The issue is fixed.