forked from tomohulk/WinSCP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileZilla_Server_Install.ps1
More file actions
30 lines (25 loc) · 981 Bytes
/
FileZilla_Server_Install.ps1
File metadata and controls
30 lines (25 loc) · 981 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
30
$CurrentErrorActionPreference = $ErrorActionPreference
$ErrorActionPreference = "Stop"
try {
$is64Bit = ( Get-WmiObject -Class Win32_Processor ).AddressWidth -eq 64
$programFiles = $env:ProgramFiles
if ($is64Bit -and $programFiles -notmatch "x86") {
$programFiles = "$programFiles (x86)"
}
$installDirectory = Join-Path -Path $programFiles -ChildPath "FileZilla Server"
if (-not ( Test-Path -Path $installDirectory )) {
New-Item -Path $installDirectory -ItemType Directory |
Out-Null
}
$ftpRoot = "$env:SystemDrive\temp\ftproot"
if (-not ( Test-Path -Path $ftpRoot )) {
New-Item -Path $ftpRoot -ItemType Directory |
Out-Null
}
Copy-Item -Path "$pwd\FileZilla*.xml" -Destination $installDirectory -Force
Start-Process -FilePath "$pwd\FileZilla*.exe" -ArgumentList "/S"
} catch {
throw "$($_.Exception.Message)"
}
$ErrorActionPreference = $CurrentErrorActionPreference
return 0