Created
May 30, 2014 07:50
-
-
Save giseongeom/fe2b0d90409b484dc15b to your computer and use it in GitHub Desktop.
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
# get-koalra-files.ps1 | |
# Retrieve .pptx files from Koalra Server | |
# | |
# Author : GiSeong Eom <[email protected]> | |
# Created: 2012-06-22 | |
# Updated: 2013-03-16 | |
# ChangeLog | |
# v0.2 Updated for SC2012 LAB files | |
# v0.1 Originally written | |
# Global Variables | |
$ErrorActionPreference = "silentlyContinue" | |
$strKoalra_home = "https://content.koalra.com" | |
$strKoalra_download_URL = "https://content.koalra.com" | |
# Check PowerShell version | |
if ($Host.Version.Major -ne 3) | |
{ | |
Write-Output "Warning: PowerShell v3 is the only supported platform." | |
Break | |
} | |
# Get Authentication Info. | |
$cred = Get-Credential | |
# Get index.html | |
$SiteIndex = (Invoke-WebRequest -Credential $cred -uri $strKoalra_download_URL) | |
# Get files' uri list | |
$FileList = ($SiteIndex | ForEach-Object Links | Where-Object { $_.innerText -ne "web.config" } | ForEach-Object Href) | |
# Download...... | |
Foreach ( $myFile in $FileList ) | |
{ | |
Start-BitsTransfer -source $strKoalra_home$myFile -Credential $cred -Authentication Basic -Destination $PWD | |
} | |
Write-Host "Download completed. Check $PWD" | |
# EOL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment