Hi Andy,
I have never tried running Agents inside WSL (or WSL2) but my guess is that the script will run as whatever account the Go Agent service runs under.
So if you want the script to run as root there are a few options:
1. Run the Go Agent service as root,
2. Grant the "go" user permission to run the script as root via sudo, either with password or without, or
3. Set the script owner to "root" and set the sticky bit so that whenever _anybody_ runs the script it runs as root. (This is probably only viable if the script is a permanent fixture inside the WSL installation. If the script is pulled from elsewhere at runtime then it will be owned by the "go" user and this just moves the problem around, forcing you to find a way to run chown and chmod as root instead of the script itself.)
Hope this helps,
Jason