When I debug below lines of code in VS code it works fine.But, When this code executes in azure devops (release pipeline azure powerShell task), I get below task error.