How do I determine if a build agent is enabled prior to executing a pipeline task, in powershell?

Wayne Pfeffer 1 Reputation point

I have a powershell task in a pipeline that cleans out old build directories from inside the agent directory on the build server. This is self hosted up in Azure. I need to be able to determine if the agent is enabled prior to the task executing. Is this even possible?

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
32,720 questions
{count} votes