Last active
December 24, 2017 10:15
-
-
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.
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 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