Skip to content

Instantly share code, notes, and snippets.

@georgechang
Last active December 24, 2017 10:15
Show Gist options
  • Save georgechang/540b41713d8e0e9c258a9945cd16ef25 to your computer and use it in GitHub Desktop.
Save georgechang/540b41713d8e0e9c258a9945cd16ef25 to your computer and use it in GitHub Desktop.
When you're building out a new server and you don't want to deal with all the default IE restrictions just to download Sitecore installation files.
function Get-SitecoreInstallation {
param(
[string]$Url,
[string]$UserName,
[string]$Password,
[string]$FilePath
)
$loginRequest = Invoke-RestMethod -Uri https://dev.sitecore.net/api/authorization -Method Post -ContentType "application/json" -Body "{username: '$UserName', password: '$Password'}" -SessionVariable session -UseBasicParsing
Invoke-WebRequest -Uri $url -WebSession $session -OutFile $FilePath -UseBasicParsing
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment