/PowerShell-Functions

Short PowerShell functions to be used in larger scripts.

Primary LanguagePowerShellMIT LicenseMIT

PowerShell-Functions

PowerShell functions that I use in multiple scripts.

add-LogEntry

Similar to Tee-Object, this function will output data to the screen and a log file. However, it will timestamp the log file entries.

Gif of add-LogEntry in action

get-FormattedDate

Get-FormattedDate takes any date and returns a readable date in ordinal format. For example, "Jan 16 1992" returns "Thursday, January 16th, 1992".

Gif of get-FormattedDate in action

remove-Diacritics

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.

Image showing remove-Diacritics string discritics from an entered username