We have set up the Azure DevOps Release Pipeline with a custom Agent that is running in Azure VM. Agent has to run also end-to-end tests from DevOps Release, hence it starts interactively via:
C:\windows\system32\cmd.exe /D /S /C start "Agent with AutoLogon" "C:\agent\run.cmd" --startuptype autostartup
User that is automatically logged in (and runs the command above) VM is part of Administrator group. Everything runs fine until I try to run "PowerShell Script" which requires admin privileges. For example "Import-Certificate" command gives me "Access Denied" error. I know about workaround with
Start-Process powershell -ArgumentList 'command' -Verb RunAs
That is working fine, but with this, I am missing the output of the 'command'. I mean, whether the 'command' fails or succeeds it does not notify back to output.
Any ideas on how can I run elevated PS or what other permissions to configure?