-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEagleInstall.ps1
More file actions
43 lines (39 loc) · 1.35 KB
/
EagleInstall.ps1
File metadata and controls
43 lines (39 loc) · 1.35 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Install Eagle.net
# Rich Mawdsley / Ensono
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[ValidateSet("Install", "Uninstall")]
[string]$InstallMode
)
if ($InstallMode -eq "Install"){
try {
Write-Host "Copying Eagle files to machine"
Copy-Item -Path ".\Eagle.net" -Destination "C:\Program Files (x86)\QAD\Eagle.net" -Recurse -Force
Copy-Item ".\EagleUpgradeDoneV1.txt" -Destination "C:\Program Files (x86)\QAD\Eagle.net" -Force # ConfigMgr Detection File
Copy-Item ".\Start_Eagle.lnk" -Destination "C:\Users\Public\Desktop" -Force
Copy-Item ".\Close_Eagle.lnk" -Destination "C:\Users\Public\Desktop" -Force
}
catch {
Write-Host "Failed to copy files"
}
try {
Write-Host "Copying Eagle files to user profile Documents"
$Destination = 'C:\users\*\Documents\'
Get-ChildItem $Destination | ForEach-Object { Copy-Item -Path '.\Documents\*' -Destination $_ -Force }
}
Catch {
Write-Host "Failed to copy files to user profiles"
}
}
if ($InstallMode -eq "Uninstall"){
try {
Write-Host "Removing Eagle files from machine"
Remove-Item -Path "C:\Program Files (x86)\QAD\Eagle.net" -Recurse -Force
Remove-Item "C:\Users\Public\Desktop\Start_Eagle.lnk" -Force
Remove-Item "C:\Users\Public\Desktop.\Close_Eagle.lnk" -Force
}
catch {
Write-Host "Failed to copy files"
}
}