Have an on-prem agent that is used when running a release pipeline. On of my tasks is a powershell script that needs to stop a windows service, hence it needs admin rights. The agent runs under an account that has admin rights so that has me wondering, how does one run a powershell script as an admin on an agent of a deployment group?
You have to elevate its permissions somehow, the same way as if you run a powershell command "run as administrator".