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