Unexpected Select-String behavior
See original GitHub issuePrerequisites
- 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
With version 7.2.12 (LTS) this command
winget list | Select-String -Pattern 'Winrar'
gives me highlighted result
WinRAR 6.22 (64-разрядная) RARLab.WinRAR 6.22.0 winget
while current version 7.3.5 gives me some strange symbols instead of highlighting.
[7mWinRAR[0m 6.22 (64-разрядная) RARLab.WinRAR 6.22.0 winget
I showed winget for example PS 7.3.5 does so with any external program. I used Select-String extensively while migrating from openssl 1.1.1 to 3.1.1 (openssl windows x64 slproweb). And had same behavior. It’s same PC and same PS profile.
Expected behavior
Highlighted result
Actual behavior
Strange symbols
Error details
No response
Environment data
PSVersion 7.3.5
PSEdition Core
GitCommitId 7.3.5
OS Microsoft Windows 10.0.19045
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visuals
Issue Analytics
- State:
- Created 3 months ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Unexpected Behavior with ControlCommand SelectString
A call to ControlCommand to set "Base Moisture" results in "Base Moisture Actuator" being selected. In the ComboBox, "Base Moisture Actuator" is ...
Read more >Unexpected select|regex behavior : r/PowerShell
Unexpected select|regex behavior. I've run into an issue when trying to use regex to select text. I have the following text in a...
Read more >Unexpected result from PowerShell regex
The "case-insensitive" regex flag is set by Select-String , which makes \p{Lu} case-insensitive, just as it does with [A-Z] .
Read more >[xsl] Unexpected behavior with xsl:choose, xsl:when, xsl:variable
I understand. Hide this message.
Read more >Unexpected Case Sensitivity in PowerShell - Scripting Blog
The PowerShell RegEx native methods (eg -match, Select-String, etc) are case insensitive, case-sensitive methods do exist (ie -cmatch). This is ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You are right - this is the same thing just another example. It’s a bit strange that it doesn’t affect PS 7.2 LTS.
OK, i’m closing the issue as a dublicate of https://github.com/PowerShell/PowerShell/issues/19425