PowerShell functions that I use in multiple scripts.
Similar to Tee-Object
, this function will output data to the screen and a log file. However, it will timestamp the log file entries.
Get-FormattedDate takes any date and returns a readable date in ordinal format. For example, "Jan 16 1992" returns "Thursday, January 16th, 1992".
Unfortunately, in Windows Active Directory and Office 365, usernames with accents or diacritics can be rejected. This function will return the entered string without its diacritics when used in user onboarding scripts.