You need to add here "taskDefinition.Principal.RunLevel" and set it to
' TASK_RUNLEVEL_TYPE
Const TASK_RUNLEVEL_LUA = 0
Const TASK_RUNLEVEL_HIGHEST = 1
IMPORTANT: If you use Highest Privilege, the script will need to run elevated!
taskDefinition.Principal.UserId = ""
taskDefinition.Principal.LogonType = TASK_LOGON_INTERACTIVE_TOKEN
taskDefinition.Principal.RunLevel = TASK_RUNLEVEL_HIGHEST