mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
Initial commit
This commit is contained in:
29
Install.ps1
Normal file
29
Install.ps1
Normal 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\$_")
|
||||
}
|
||||
Reference in New Issue
Block a user