To get the uuid of the Task during script runtime as a string variable. Use the following method:
param($CurrentTaskUuid)
Write-Host $CurrentTaskUuid
This will get a string variable like 888cec5b-6615-4e3d-80ed-8a328a4f71ba. Always start with the param() header as the first line of your PowerShell script. If so, you are able to access the current Account uuid anywhere in your script.
To access Robogator proprietary variables with PowerShell, you have to first initialize all variables on the first line of the script with e. g. param($TaskParameter, $MyKey, $followed) and after that it is possible to access the variables in the underlaying script lines.