In case you are running the agent behind a proxy server, you need to pass additional options to the agent configure script as described by https://docs.microsoft.com/en-us/vsts/build-release/actions/agents/proxy?view=vsts
From looking at the Install-VSTSAgent code this does not seem to be supported yet?