I would like to pass a username of a person who initiated deploy in Release pipeline in command line script task.
I have tried:
echo $(username)
But $(username) gives me an account of agent service, not the user who initiated deploy.
You can use the Release.RequestedFor
pre-defined variable, it ill display the display name of identity that triggered the release.