The remote name could not be resolved

Hi experts,

One of our custom activities inside Password Manager (OIPM version:  5.7.1.469) needs to make a POST to a third party API.

We are including the code in the powershell script part of the custom activity but we are getting the following error: The remote name could not be resolved: 'www.example.com'

The thing that is driving us crazy is that the same code, executed in the windows powershell console of the same machine where the OIPM server is installed… works perfectly fine.

 

The code is a simple:

function PreLoad($workflow, $activity)

{

$URI = "www.example.com/secure/messenger/soap/SendServiceNoHeader.asmx?WSDL";

$result = (iwr $URI –Body $Message –contentType "text/xml; charset=utf-8" –method POST);

}

My question is the following: What could be the difference (in terms of resolving the domain name example.com) between the powershell code executed by OIPM and the one executed directly on windows powershell console?

Thanks in advanced.