A time comes along when you need to validate an Email address using Powershell. Created a function just for this purpose as an introduction to how you may create advanced functions in powershell.
This function will “validate” an email address using the System.Net.Mail namespace and output an Boolean value indicating if an string is a valid address. It uses a structure and style that is my personal preference. Feel free to comment if you like.
Basic learning points
- It is an advanced function
- It supports the pipeline
- It displays how to create an instance of a .Net class
Cheers
Tore
Comments
Post a Comment