-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathinstall.ps1
More file actions
29 lines (25 loc) · 663 Bytes
/
install.ps1
File metadata and controls
29 lines (25 loc) · 663 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
$fileList = @(
'DocX.dll',
'MadMilkman.Docx.dll',
'MadMilkman.Docx.xml',
'PSWord.dll',
'PSWord.psd1',
'en-US/PSWord.dll-Help.xml'
)
$InstallDirectory = Join-Path -Path "$([Environment]::GetFolderPath('MyDocuments'))\WindowsPowershell\Modules" -ChildPath PSWord
if (!(Test-Path $InstallDirectory))
{
$null = mkdir $InstallDirectory
$null = mkdir $InstallDirectory\en-US
}
$wc = new-object System.Net.WebClient
$fileList | ForEach-Object {
Try
{
$wc.DownloadFile("https://github.com/guidooliveira/PSWord/raw/master/Release/$_", "$installDirectory\$_")
}
catch
{
Write-Error -Message "Error Downloading $_"
}
}