This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Save-Download { | |
<# | |
.SYNOPSIS | |
Given either the result of WebResponseObject or a Uri, will download the file to disk without having to specify a name. | |
.DESCRIPTION | |
Given either the result of WebResponseObject or a Uri, will download the file to disk without having to specify a name. | |
.PARAMETER WebResponse | |
A WebResponseObject from running an Invoke-WebRequest on a file to download. | |
.PARAMETER Uri | |
Uri of a file to download in lieu of supplying a WebResponseObject. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Disable 'Automatically detect proxy settings' in Internet Explorer. | |
# Read connection settings from Internet Explorer. | |
$regKeyPath = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\" | |
$conSet = $(Get-ItemProperty $regKeyPath).DefaultConnectionSettings | |
# Index into DefaultConnectionSettings where the relevant flag resides. | |
$flagIndex = 8 | |
# Bit inside the relevant flag which indicates whether or not to enable automatically detect proxy settings. |