So with Powershell from last time, we discovered that through Aliases it is just mimicking older DOS functions to give us a comfort level.   It’s not just a “Big Blue Command prompt”

So what is it?  Let’s try to be grey on that.  You have to be because Powershell is really HUGE when you open it up.  It IS many things to many people.

Calling it “A scripting solution” makes it sound like just a replacement to vbScript.   Calling it a Management Console ignores the scripting abilities.   Calling it a new system makes it sound isolated from the old.

Powershell is whatever YOU need it to be.   I’ll show you where it got me hooked in.   Easily being able to examine File content by date or time.

Here is a solution I personally encountered that showed me the raw Power of Powershell.

I can EASILY work with Dates and Times, and with that I can sort through files by date and time easily.

If I executive this Cmdlet


It just pulls up the Date and Time.  But If I store it away in a Variable called $TODAY


I have that information from that EXACT point in time stored.  Now for the cool stuff.   Powershell has a CmdLet called GET-MEMBER that reveals all the Members of that particular Object.   Placing a “|” between $TODAY and GET-MEMBER “Pipes” the information from $TODAY to GET-MEMBER



There is a list of very interesting Properties sitting here.  For the first time, like me you’ll start to yawn when somebody starts describing Objects.  So we’ll talk about all the fancy bits and pieces later.  The important part is I can look at INDIVIDUAL PIECES of the date easily.

So If I want to access JUST the year from my Date I can type in


or the Hour of the Day


Simple neat, so far useless to the ITPro.  We need to compare dates, Logon Dates, File Dates.  We need to easily know  how old something is.   Well again with Powershell, that easy

Believe it or not, I can just SUBTRACT dates and compare dates, step back and forth in time.


Will display the Results of $TODAY as 5 days in the future.


Will display the Results of $TODAY as 4 months from now.  But $TODAY is still intact

So here is neat thing to try so see how you can compare.  Subtract $TODAY.AddMonths(4) from $TODAY



As you can see it breaks the results down in various details.   I could compare two dates and easily know they are over 121 days apart, because Powershell will show me that.  How do I access that difference?  Here’s an example



And we’re seeing the Days as an actual number.  Can you imagine leveraging this power in YOUR environment? Next time we’ll show you how on the file system.

Remember the Power of Shell is in YOU

The Energized Tech