Turn Powershell Script Into Functions