The Surly Admin

Father, husband, IT Pro, cancer survivor

Quick Script: Date Ranges

Ever need to get an array of all the days between two dates?  This script will calculate the date range and load up an array with date/time objects for every date in between the entered times:

To use it, simply call the function

  • Get-DateRange
  • Get-DateRange -Start 7/24/14 -End 8/1/14
  • Get-DateRange -End 7/20/14

And just to pretty it up as a Function and with comment-based help:

Advertisements

July 25, 2014 - Posted by | PowerShell |

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: