I invite you to follow me on Twitter and Facebook.
Join me tomorrow for more Windows PowerShell cool stuff.
So given that I can find stuff in less than a minute, it does not really pay for me to spend hours trying to find out how to search by “date modified.” Windows PowerShell makes it easy. Not only that, but the command is pretty fast as well. But it actually took me less than a minute to whip out the command, and it worked the very first time I ran it. I love the Windows Search tool, and I am certain it could help me find files that I modified in October of last year. Personally, I use Windows PowerShell every day and these days, I do not do that much actual system administration. If you get really good with Windows PowerShell, you improve more than just your system admin skills. PS C:\> Get-ChildItem -Path C:\data -Recurse | Measure-Object So how many files is that? Well, it is more than 46,000 files. LastWriteTime Property System.DateTime LastWriteTime
PS C:\> Get-Item C:\fso\a.txt | gm -Name lastwritetime The cool thing is that the LastWriteTime property is an instance of a System.DateTime object. The next thing is that I know I modified the file during the month of October in the year of 2011. Get-ChildItem -Path C:\data -Recurse -Include *.doc,*.docx docx files from the Data directory on my computer. Because my Data folder is deeply nested, I need to do a recursive search. docx file extension, it really does not matter. In addition, although I cannot remember if the files have a. For example, to find my missing lab files, I use the Get-ChildItem cmdlet and search my Data directory. The neat thing is that because I do know Windows PowerShell so well, I can compensate. OK, so maybe I am not the world’s greatest computer user, but I know Windows PowerShell really well. Use Windows PowerShell to find files by date After spending 15 minutes attempting to browse and search for these files, I finally gave up. In fact, I spent each day teaching the class, the evenings with friends, and the nights writing new labs for the coming day’s class. When the Scripting Wife and I were in Montreal, Canada last October, I remember writing some additional Windows PowerShell labs for the class. However, one thing I have not figured out used to be very easy in the Windows 95 days by using the old-fashioned Find utility-that is to find a file by date. By default the datetime format needs to be mmddHHMM ccyy. To set the date in shell using the date command line on Unix and macOS, you do not need any options.
I modified the indexing to include the full contents of my Windows PowerShell script files, and it works great. The date command line allows you to also set your operating system date and time on Linux and Unix systems. At times, I will ask her to find something that I have wasted 15 minutes seeking, and she can find it almost immediately.Ī case-in-point is Windows Search. In my office, often the Scripting Wife sits beside me and does whatever she does. In fact, when it comes to finding things on the Internet, the Scripting Wife often is faster than I am. I am not the best computer user in the world. Microsoft Scripting Guy, Ed Wilson, is here. Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to find files modified by month and year.