You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not necessarily a bug but a nuisance that hopefully may be avoided with a tweak.
The steps to reproduce in Windows PowerShell console, e.g. v5.1:
change to this repository root directory
invoke
Select-EverythingStringSearch-Everything
As a result, the command emits errors like:
Microsoft.PowerShell.Utility\Select-String : The file ...\PSEverything\.git
cannot be read: Access to the path '...\PSEverything\.git' is denied.
At line:1 char:1
+ Select-EverythingString Search-Everything
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Select-String], ArgumentException
+ FullyQualifiedErrorId : ProcessingFile,Microsoft.PowerShell.Commands.SelectStringCommand
Presumably this happens because the underlying Search-Everything gets and
passes all file system entry paths to Select-String, including folders. Select-String does not like input directory paths in v5.1.
NOTE: The same command works without errors in PowerShell Core.
Perhaps Select-String learned to ignore directory paths.
I am thinking of the fix of SelectEverythingStringCommand.cs like:
This is not necessarily a bug but a nuisance that hopefully may be avoided with a tweak.
The steps to reproduce in Windows PowerShell console, e.g. v5.1:
As a result, the command emits errors like:
Presumably this happens because the underlying
Search-Everything
gets andpasses all file system entry paths to
Select-String
, including folders.Select-String
does not like input directory paths in v5.1.I am thinking of the fix of
SelectEverythingStringCommand.cs
like:With the above we tell
Search-Everything
to return just files, so thatSelect-String
is happy in any PowerShell.If you find the suggested fix reasonable and a PR is welcome I can take care of this.
The text was updated successfully, but these errors were encountered: