PowerShell [DateTime] throws the error “String was not recognized as a valid DateTime.”

In some of my scripts, such as Get-AutoDiscoverRecords.ps1, I convert the string output of another command (such as an LDAP query) into a Date and Time variable by using the type cast [DateTime]. For example the following will turn the string “06/16/2016 3:14:03 PM” into a PowerShell DateTime object for June 16th 2016 at 3:14PM:…

3

Use PowerShell to determine the first and last days of the current calendar quarter.

Time for some fun with PowerShell. 🙂 ***Updated to include code Eric created to determine the last day of the quarter at the bottom of this entry*** My colleague Eric Powers has PowerShell script that queries a bunch of data from the last 90 days. The intention of the script is to only collect data…

3

Leveraging the PowerShell Script Version Control Process for Exchange Cumulative Update Distribution

This is the second in a two-part blog post covering the topic of how to maintain version control over PowerShell scripts and Exchange 2016 deployment files in a large environment. The first blog post should be reviewed before continuing here because the information below builds on the PowerShell Version Control Process (PSVCP) established in that…


Maintaining Version Control Over Distributed PowerShell Scripts

This is the first in a two-part blog post covering the topic of how to maintain version control over PowerShell scripts and Exchange 2016 deployment files in a large distributed environment (the second post titled Leveraging the PowerShell Script Version Control Process for Exchange Cumulative Update Distribution is now live). I say large environment because…

5