You can enable network proxy communication in your PowerShell script by using context parameters.

Certain PowerShell cmdlets might require that you set a network proxy as an environment variable in your PowerShell function. Proxy configurations are provided to the PowerShell function with the $context.proxy.host and $context.proxy.host parameters.

You can add these context parameters in the beginning of your PowerShell script.
$proxyString = "http://" + $context.proxy.host + ":" + $context.proxy.port
$Env:HTTP_PROXY = $proxyString
$Env:HTTPS_PROXY = $proxyString

If the cmdlets support the -Proxy parameter, you can also pass the proxy value directly to the specific PowerShell cmdlets.