Search results: How to display seconds in date columns?
Search results: How to display seconds in date columns?
Search results, date columns:
Is it possible to show the time including seconds?
'date hh:mm:ss'
How?
Is it possible to show the time including seconds?
'date hh:mm:ss'
How?
Re: Search results: How to display seconds in date columns?
Please try changing the Everything time format:
In Everything, type in the following search and press ENTER:
/time_format=hh:mm:ss
In Everything, type in the following search and press ENTER:
/time_format=hh:mm:ss
Re: Search results: How to display seconds in date columns?
Came to find out if es.exe (Commandline) could format a sortable date and saw this.
Didn't see the answer and the syntax that worked in the GUI didn't seem to have an effect.
Work around: In Windows TIme Settings (click on task bard time/clock). set the date and time formats there.
I noticed by reading the cli.c source code to es.exe that it had a "to-do" for custom time formats but also was using/respecting the System LOCALE.
Nice. Once again, Everything and ES exceed expectations.
FYI: Sortable dates (as a first step to custom date/time varieties) would be VERY NICE. I've been piping the output of ES to PowerShell to get an "object" that I could easily sort (or format). Which isn't a bad trick for others to know in any case.
Didn't see the answer and the syntax that worked in the GUI didn't seem to have an effect.
Work around: In Windows TIme Settings (click on task bard time/clock). set the date and time formats there.
I noticed by reading the cli.c source code to es.exe that it had a "to-do" for custom time formats but also was using/respecting the System LOCALE.
Nice. Once again, Everything and ES exceed expectations.
FYI: Sortable dates (as a first step to custom date/time varieties) would be VERY NICE. I've been piping the output of ES to PowerShell to get an "object" that I could easily sort (or format). Which isn't a bad trick for others to know in any case.
Re: Search results: How to display seconds in date columns?
Take a look at the options of ES.exe. Among those are options to sort the results.HerbM wrote:Sortable dates (as a first step to custom date/time varieties) would be VERY NICE.
Example:
es.exe test ext:txt -sort date-modified -sort-descending
ES.EXE test ext:txt /o-d
Could you provide an example? (I do know how that works, but maybe other people here don't)HerbM wrote: I've been piping the output of ES to PowerShell to get an "object" that I could easily sort (or format). Which isn't a bad trick for others to know in any case.
Re: Search results: How to display seconds in date columns?
> Coule you provide an example of how that works? (for others...)
Sure.
First of all there are ways to do much of this in es.exe directly. But not everything can be done in everything (yet?), so knowing how to use es.exe and PowerShell together is a very useful skill set.
Here's a sorted datetime for finding all the copies of 7z on your system. BTW, this is a good idea to try, as there were bugs/security issues in previous versions of 7Zip and it's astounding how many programs load 7z privately.
By sending the es.exe output through Get-ChildItem we send an OBJECT down the pipeline. Objects require no parsing, so we can manipulate the MEMBER PROPERTIES (or even methods) directly and easily
After that, the rest is obvious: Get the file, sort, select the properties we want to display (or pass to another command.)
Selecting the properties is optional, but in most cases like this you will prefer it to outputting either the entire "object" (all properties" or whatever is the DEFAULT formatted display of that object type. However, it's YOUR option.
Another idea that es.exe doesn't do (AFAIK) is to find "File versions", but PowerShell can do this easily, and once we know the patterns above we can enter the command easily as well.
There were a lot more, and you can see that some have no versions or that 9.20 that snuck through and I need to replace.
What's new here? Adding "-expand" to Select-Object for the VersionInfo. VersionInfo itself is a "complex object" so simply selecting it won't give good results. We need to "EXPAND" out the VersionInfo properties.
Adding the datetime from the main FileInfo object to the VersionInfo object is a bit trickier (though not too difficult).
It's on my "to do" list so if there is interest I can work that out and post it in a followup.
Sure.
First of all there are ways to do much of this in es.exe directly. But not everything can be done in everything (yet?), so knowing how to use es.exe and PowerShell together is a very useful skill set.
Here's a sorted datetime for finding all the copies of 7z on your system. BTW, this is a good idea to try, as there were bugs/security issues in previous versions of 7Zip and it's astounding how many programs load 7z privately.
If we didn't know how to do it the we could use PowerShell to "help" like this:es 7z.exe -dm -sort-datemodified-ascending
That Get-ChildItem might seem unnecessary, given that es.exe is already sending the filenames, but the issue is that PowerShell can do far more with "Objects" than with simple strings.es 7z.exe | Get-ChildItem | Sort-Object LastWriteTime | Select-Object Length,LastWriteTime,Name,Directory
es 7z.exe | dir | Sort LastW*e | Select Len*,LastW*E,Name,Dir*E # alternative with less typing
By sending the es.exe output through Get-ChildItem we send an OBJECT down the pipeline. Objects require no parsing, so we can manipulate the MEMBER PROPERTIES (or even methods) directly and easily
After that, the rest is obvious: Get the file, sort, select the properties we want to display (or pass to another command.)
Selecting the properties is optional, but in most cases like this you will prefer it to outputting either the entire "object" (all properties" or whatever is the DEFAULT formatted display of that object type. However, it's YOUR option.
Another idea that es.exe doesn't do (AFAIK) is to find "File versions", but PowerShell can do this easily, and once we know the patterns above we can enter the command easily as well.
Code: Select all
es 7z.exe | dir | Sort LastWriteTime | Select -expand VersionInfo
ProductVersion FileVersion FileName
-------------- ----------- --------
18.05 18.05 C:\ProgramData\Local\Julia\bin\7z.exe
18.05 18.05 C:\util\7-Zip\App\7-Zip64\7z.exe
18.05 18.05 C:\util\7z.exe
18.05 18.05 C:\ProgramData\chocolatey\tools\7z.exe
18.05 18.05 C:\Program Files\Unity\Editor\Data\Tools\7z.exe
C:\ProgramData\chocolatey\lib\openssh\tools\7z.exe.ignore
9.20 9.20 C:\Users\A469526\Downloads\CSScriptNpp.Updater\7z.exe
What's new here? Adding "-expand" to Select-Object for the VersionInfo. VersionInfo itself is a "complex object" so simply selecting it won't give good results. We need to "EXPAND" out the VersionInfo properties.
Adding the datetime from the main FileInfo object to the VersionInfo object is a bit trickier (though not too difficult).
It's on my "to do" list so if there is interest I can work that out and post it in a followup.
Re: Search results: How to display seconds in date columns?
Thanks for your (very well written) explanation!
Select has a nice option to create your own "fields" to report (also available in other commands, btw)
You can use it like this (just an example):
.\es.exe 7z.exe | gi | select LastWriteTime, FullName, @{LAbel = "Version";Expression = {$_.VersionInfo.FileVersion}}, Length
( gi = Get-Item ; select = Select-Object )
I don't want to steal your thread and/or ruin your fun, so this is a 'hidden' text for one way to get this done. (select the text show)HerbM wrote:Adding the datetime from the main FileInfo object to the VersionInfo object is a bit trickier (though not too difficult).
It's on my "to do" list so if there is interest I can work that out and post it in a followup.
Select has a nice option to create your own "fields" to report (also available in other commands, btw)
You can use it like this (just an example):
.\es.exe 7z.exe | gi | select LastWriteTime, FullName, @{LAbel = "Version";Expression = {$_.VersionInfo.FileVersion}}, Length
( gi = Get-Item ; select = Select-Object )
Re: Search results: How to display seconds in date columns?
First and foremost, I love Everything (es really) - it's become part of my everyday workflow for so many things. 'Everyday' actually understates it, there's almost not an hour goes by that I don't use it. (MORE often that that really.)
I live at the command line -- for everything (heh heh) except Email, Browsing Inet, and Editing, but even for those I do much of my work from the command line -- opening files to edit from the console (PowerShell).
Unfortunately, no one else seems very interested. The thread would be MORE FUN if people would jump in, ask questions and give their own ideas.
And those that don't do PowerShell much will find it tedious to type all of that repeatedly, but PowerShell can fix that really easily -- with a function or cmdlet.
My first version was based on this pattern (similar to yours):
I have a nearly finished (but workable) version that does ES output, regular file listings, Services and Processes.
Again, if there's interest I can post that.
I live at the command line -- for everything (heh heh) except Email, Browsing Inet, and Editing, but even for those I do much of my work from the command line -- opening files to edit from the console (PowerShell).
Won't steal my thread or fun -- I love this stuff and your method is the basis of what I was expecting to do.I don't want to steal your thread and/or ruin your fun, so this is a 'hidden' text for one way to get this done. (select the text show)
Unfortunately, no one else seems very interested. The thread would be MORE FUN if people would jump in, ask questions and give their own ideas.
Excellent.Select has a nice option to create your own "fields" to report (also available in other commands, btw)
You can use it like this (just an example):
.\es.exe 7z.exe | gi | select LastWriteTime, FullName, @{LAbel = "Version";Expression = {$_.VersionInfo.FileVersion}}, Length
( gi = Get-Item ; select = Select-Object )
And those that don't do PowerShell much will find it tedious to type all of that repeatedly, but PowerShell can fix that really easily -- with a function or cmdlet.
My first version was based on this pattern (similar to yours):
Code: Select all
es 7z.exe | dir | ForEach { $LWT = $_.LastWriteTime.ToString('yyyy-MM-dd HH:mm'); $Len=$_.Length; $_ } | Select -expand VersionInfo | Select ProductVersion,@{N='LastWriteTime';E={$LWT}}, @{N='Length';E={$Len}},FileName | Sort LastWriteTime
ProductVersion LastWriteTime Length FileName
-------------- ------------- ------ --------
18.05 2018-04-30 07:00 461824 C:\ProgramData\chocolatey\tools\7z.exe
18.05 2018-04-30 07:00 461824 C:\ProgramData\chocolatey\lib\openssh\tools\7z.ex
18.05 2018-04-30 07:00 461824 C:\ProgramData\chocolatey\lib\chocolatey\tools\ch
18.05 2018-04-30 07:00 461824 C:\util\7-Zip\App\7-Zip64\7z.exe
18.05 2018-04-30 07:00 461824 C:\util\7-Zip\App\7-Zip\7z.exe
18.05 2018-04-30 07:00 461824 C:\util\7z.exe
18.05 2018-04-30 07:00 461824 C:\esb\old\saveTRGRunbook\7z.exe
18.05 2018-04-30 07:00 461824 C:\esb\tt\TRGRunbook\7z.exe
18.05 2018-04-30 07:00 461824 C:\esb\trgrunbookTEMP\7z.exe
18.05 2018-04-30 07:00 461824 C:\Program Files\Unity\Editor\Data\Tools\7z.exe
Again, if there's interest I can post that.
Re: Search results: How to display seconds in date columns?
Same here! (but probably not as much as you do).
This might fit in your workflow then:
Code: Select all
function QCD
{
es.exe -sort run-count folder: !c:\windows $args | Out-GridView -outputmode Single -Title "Select folder to go to ..." | % {pushd $_ ; es.exe -inc-run-count "$_"}
}
Re: Search results: How to display seconds in date columns?
I like it.
is it the "run count" switch set that isn't documented?
The GUI popup is slick though not my style, but it's given me a couple of ideas already for enhancing my own Set-GoLocation and my version of "cd" (Set-LocationFile).
They are separate right now but probably will be combined. Using this I can do some quite sophisticated enhancements.
BTW, Set-LocationFile lets you "cd to a file", takes pipeline input too, so I already use it with Where.exe and ES.
es SOMEPATTERN | select -first | cd # just works for file or directories
is it the "run count" switch set that isn't documented?
The GUI popup is slick though not my style, but it's given me a couple of ideas already for enhancing my own Set-GoLocation and my version of "cd" (Set-LocationFile).
They are separate right now but probably will be combined. Using this I can do some quite sophisticated enhancements.
BTW, Set-LocationFile lets you "cd to a file", takes pipeline input too, so I already use it with Where.exe and ES.
es SOMEPATTERN | select -first | cd # just works for file or directories
Re: Search results: How to display seconds in date columns?
The "undocumented" referred to the script itself. Normally when I post here, there is some explanation of what it is, how it works, how to use, etc.
BTW, Set-LocationFile lets you "cd to a file", takes pipeline input too, so I already use it with Where.exe and ES.
Code: Select all
Function Go
{
es.exe -sort run-count !c:\windows $args | Out-GridView -outputmode Single -Title "Select folder to go to ..." | gi | % {
if ($_.PSIsContainer) {cd $_} else {cd $_.Directory}
}
}
Code: Select all
#======================================================================
# SD (Speed Dial). CD to predefined folders with a "speeddial" number)
#======================================================================
#$A = (gc "$profile\..\speeddial.txt") -match '^[^ #]'
$A = @(`
# Examples regular folders
"c:\Windows\system32" ,
"c:\tools" ,
"C:\2install" ,
"C:\Program Files" ,
# Examples environment variables
"$env:APPDATA" ,
"$env:WINDIR\System32" ,
"$env:HOMEDRIVE$env:HOMEPATH" ,
# Examples shell folders
[environment]::getfolderpath('Desktop') ,
[environment]::getfolderpath('Personal') ,
[environment]::getfolderpath('System')
)
$SpeedDial = ( $A | % {
$ExecutionContext.InvokeCommand.ExpandString($_)
})
$A = $null
#______________________________________________________________________
#
function SD
#______________________________________________________________________
#
{
if ($args[0] -is [int])
{ cd (gi $SpeedDial[$args]) }
else
{ for($i = 0; $i -lt $SpeedDial.Count; $i++) {
"[$i] $($SpeedDial[$i])"
}
}
}
How does that work for you? It's a bit like Google's "I feel lucky": go to the first entry that comes up ..es SOMEPATTERN | select -first | cd # just works for file or directories
BTW: can be optimized to:
es -n 1 SOMEPATTERN | cd ....
option -n 1 : show max 1 result; that way you don't need the select -first. Shorter and faster.