mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
29 lines
843 B
PowerShell
29 lines
843 B
PowerShell
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\$_")
|
|
} |