Initial commit

This commit is contained in:
Doug Finke
2015-05-17 09:50:17 -04:00
parent 40406cd5ca
commit acfb7b0c25

29
Install.ps1 Normal file
View File

@@ -0,0 +1,29 @@
param([string]$InstallDirectory)
$fileList = echo EPPlus.dll ImportExcel.psd1 ImportExcel.psm1
if ('' -eq $InstallDirectory)
{
$personalModules = Join-Path -Path ([Environment]::GetFolderPath('MyDocuments')) -ChildPath WindowsPowerShell\Modules
if (($env:PSModulePath -split ';') -notcontains $personalModules) {
Write-Warning "$personalModules is not in `$env:PSModulePath"
}
if (!(Test-Path $personalModules)) {
Write-Error "$personalModules does not exist"
}
$InstallDirectory = Join-Path -Path $personalModules -ChildPath ImportExcel
}
if (!(Test-Path $InstallDirectory)) {
$null = mkdir $InstallDirectory
}
$wc = New-Object System.Net.WebClient
$fileList |
ForEach-Object {
$wc.DownloadFile("https://raw.github.com/dfinke/ImportExcel/master/$_","$installDirectory\$_")
}