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.