@@ -30,11 +30,11 @@ public class SearchEverythingCommand : PSCmdlet
3030 [ Parameter ( ParameterSetName = "default" ) ]
3131 public string [ ] PathExclude { get ; set ; }
3232
33- [ Alias ( "fi " ) ]
33+ [ Alias ( "foi " ) ]
3434 [ Parameter ( ParameterSetName = "default" ) ]
3535 public string [ ] FolderInclude { get ; set ; }
3636
37- [ Alias ( "fe " ) ]
37+ [ Alias ( "foe " ) ]
3838 [ Parameter ( ParameterSetName = "default" ) ]
3939 public string [ ] FolderExclude { get ; set ; }
4040
@@ -212,10 +212,11 @@ void AddNameLengthFilter(StringBuilder searchBuilder)
212212 }
213213 protected override void ProcessRecord ( )
214214 {
215-
215+ Everything . Reset ( ) ;
216216 Everything . SetMatchCase ( CaseSensitive ) ;
217217 Everything . SetMatchWholeWord ( MatchWholeWord ) ;
218218 Everything . SetRegEx ( ! String . IsNullOrEmpty ( RegularExpression ) ) ;
219+ Everything . SortResultsByPath ( ) ;
219220
220221 ulong skip = PagingParameters . Skip ;
221222 if ( skip > Int32 . MaxValue )
@@ -242,6 +243,7 @@ protected override void ProcessRecord()
242243 Everything . SetOffset ( ( int ) skip ) ;
243244 }
244245
246+
245247 var searchPattern = GetSearchString ( ) ;
246248 WriteDebug ( "Search-Everything search pattern:" + searchPattern ) ;
247249 Everything . SetSearch ( searchPattern ) ;
@@ -253,8 +255,7 @@ protected override void ProcessRecord()
253255 var total = PagingParameters . NewTotalCount ( ( ulong ) resCount , 1.0 ) ;
254256 WriteObject ( total ) ;
255257 }
256- var res = Everything . GetAllResults ( resCount ) ;
257- Array . Sort ( res ) ;
258+ var res = Everything . GetAllResults ( Math . Min ( resCount , ( int ) first ) ) ;
258259 WriteObject ( res , enumerateCollection : ! AsArray ) ;
259260 }
260261 }
0 commit comments