That is port 443, or just https is enough.
So you are behind a Proxy (between the station where you run the script and the ESXi node)?
If the Proxy is the cause of the issue with the Copy-VMGuestFile cmdlet, you might want to check your PowerCLI configuration.
What is set for ProxyPolicy? Is that UseSystemProxy?
If not try setting that with Set-PowerCLIConfiguration.
If that doesn't work, you could try setting the Proxy address via the default parameter variable for Invoke-WebRequest.
Before calling the Invoke-VMScriptPlus function do the following (fill in your Proxy URI)
$PSDefaultParameterValues["Disabled"] = $False
$PSDefaultParameterValues=@{"Invoke-WebRequest:Proxy"="http://proxy-fqdn"}
If you Proxy requires credentials, you will also need to do this.
Make sure $proxyCred contains a PSCredential object with the Proxy credentials.
$PSDefaultParameterValues=@{"Invoke-WebRequest:ProxyCredential"=$proxyCred}
This will of course only fix Invoke-VMSCriptPlus and not Copy-VMGuestFile.
But at least we know where the issue comes from.
The only solution for the latter I can think of is to set the Proxy as the system default.
And then make sure PowerCLICOnfiguration is set to UseSystemProxy.