This is done using tcl for convenience. If you do not have it installed you can download freewrap executable and rename freewrap.exe to wish.exe or freewrapTCLSH.exe to tclsh.exe.

Registry Key : HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\
REG_SZ AutoConfigURL = https://<your url>/proxy.pac
REG_DWORD ProxyEnable = 0

This is the tcl script:

package require http

set pacURL [registry get {HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings} AutoConfigURL]
puts $pacURL

set conn [::http::geturl $pacURL]
::http::wait $conn
puts [::http::data $conn]