chocolatey/chocolatey — pull request #171 by ewilde (2012-09-22 10:50:17+00:00)
Title: Support for custom headers downloading files

Some web sites require specific headers to allow you to download the
setup program/zip

functions:
Get-WebFile.ps1
Get-ChocolateyWebFile.ps1
Install-ChocolateyPackage.ps1
Install-ChocolateyZipPackage.ps1

now support an options hashtable which allows use to specify individual
headers.

The options hash table structure allows for future settings to be flowed through the application without updating multiple method signatures.

The structure at the moment is:

$options = @ {
Headers = @{
Header1 = 'somevalue'; Header2 = 'somevalue'
}
}

In the future you could use the options to pass down cookies by domain for example

$options = @ {
Headers = @{
Header1 = 'somevalue'; Header2 = 'somevalue'
};
Cookies = @{
'http://domain.com' = 'value1';
'http://secure.domain.com = 'value2';
}
}