Added proper powershell header, added some input validation.