Skip to content

Commit

Permalink
Fetched the user_data_base script from S3 using Read-S3Object instead…
Browse files Browse the repository at this point in the history
… of Invoke-WebRequest
  • Loading branch information
citruspi committed Aug 23, 2016
1 parent b510acf commit c12103a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions data/user_data_base_fetch_s3.ps2
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
# Fetch Windows User Data from GitHub

$HUDL_DIRECTORY = "c:\\hudl"
$USER_DATA_URI = "https://s3.amazonaws.com/hudl-chef-artifacts/windows/user_data_base.ps2"
$USER_DATA_S3_BUCKET = "hudl-chef-artifacts"
$USER_DATA_S3_KEY = "windows/user_data_base.p2"
$USER_DATA_FILE_PATH = "c:\\hudl\\user_data_base.ps1"

if(!(Test-Path -Path $HUDL_DIRECTORY )){
New-Item -ItemType directory -Path $HUDL_DIRECTORY
}

Write-Output "Fetching user data from GitHub"
Invoke-WebRequest $USER_DATA_URI -OutFile $USER_DATA_FILE_PATH
Write-Output "Fetching user data from S3"
Read-S3Object -BucketName $USER_DATA_S3_BUCKET -Key $USER_DATA_S3_KEY -File $USER_DATA_FILE_PATH

Write-Output "Executing user data"
Invoke-Expression $USER_DATA_FILE_PATH
Expand Down

0 comments on commit c12103a

Please sign in to comment.