Access first Key secret by default in PowerShell

This method helps to exclude secrets and passwords from the script itself. So be compliant right from the start. The Key secrets are stored as hash values in the Robogator database. Just in time, in fact, only during the script runtime are the key secret available as decoded values. Add the Key secrets you want to access in the script the Task first.

You can access the the first Key secret as a string with the following method during the script runtime:

This is helpful if you want to keep the Key secret value self adjustable to the Key set on the Task. So there is no need to edit the script if you change the Key itself on the Task.

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.

Updated on February 21, 2025
So, how does that make you feel, now you've read this explanation?