`ls` is not self-consistent
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
I have a file .\o\abc [defg].pdf
, then I try all commands below to ls
it. The first char y/x represents that the corresponding command works or not, i.e. prints the file or nothing without any error.
y ls 'abc `[defg`].pdf' -Recurse
y ls 'abc `[defg`].pdf' -Recurse -File | ls
x ls (ls 'abc `[defg`].pdf' -Recurse).FullName
x ls "$((ls 'abc `[defg`].pdf' -Recurse).FullName)"
x ls (ls 'abc `[defg`].pdf' -Recurse -File).ToString()
Expected behavior
All commands above should works exactly the same way.
Actual behavior
Just as the first char y/x in each command line shows. Output of `ls` can't be recognized by `ls` itself when the output is not passed via pipeline.
Error details
No response
Environment data
Name Value
---- -----
PSVersion 7.2.6
PSEdition Core
GitCommitId 7.2.6
OS Microsoft Windows 10.0.19043
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
### Visuals
_No response_
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
'ls' is not recognized as an internal or external command ...
I get this error when I try to glance at the files of my folder. cmd opened regularly(not as an admin).
Read more >`ls` is not self-consistent · PowerShell/PowerShell@918bb8c
PowerShell · Code · Issues · Pull requests · Discussions · Actions · Projects · Security · Insights.
Read more >Linear Scaling Self Consistent Field Methods
In CP2K, Linear scaling ( LS ) methods are relatively new. Whereas LS is generally efficient with methods that require a minimal basis,...
Read more >'ls' is not recognized as an internal or external ... - YouTube
In this video, we're going to show you how to fix ' ls ' not being recognized as an internal or external command,...
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
@mklement0 yes 18038 is only another example of escaped wildcards not being processed correctly, there seems to be independent code in multiple places making similar errors, so a fix for 18038 wouldn’t fix 17992 and vice versa.
As another example, on Windows
dir | out-file -path 'files [Sept].txt'
gives a “file does not exist”, butdir | out-file -path 'files `[Sept`].txt'
will create a file with`
in the name, I think this is another distinct bit of code.@mklement0 I brought this up at the cmdlet working group yesterday. Things are being looked at again, although we may get the same conclusion as before. The point you make in 9475 that
Set-Content
andOut-File
work differently suggests “cmdlet thing which is relatively easy to fix”, rather than “provider minefield”You’ve got the best list of related issues for this that I’ve see so far here https://github.com/PowerShell/PowerShell/issues/17106#issuecomment-1088755835
I want to make sure this points to that one 😃