Addition of Pester and splitting out the functions. Turned the script into a module for ease of use