Changed create task function.

Task is now created without utilizing an external batch file and the
create task code is now embedded in the main PS script