forked from fleschutz/PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirefox-installer.ps1
More file actions
executable file
Β·31 lines (26 loc) Β· 922 Bytes
/
firefox-installer.ps1
File metadata and controls
executable file
Β·31 lines (26 loc) Β· 922 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
ο»Ώ<#
.SYNOPSIS
firefox installer
.DESCRIPTION
Download and install latest firefox
.EXAMPLE
PS> ./firefox-installer.ps1
.LINK
https://github.com/pakoti/Awesome_Sysadmin
.NOTES
Author: Dark Master | License: CC0-1,0
#>
try {
$StopWatch = [system.diagnostics.stopwatch]::startNew()
$Path = $env:TEMP;
$Installer = "chrome_installer.exe"
Invoke-WebRequest "https://cdn.stubdownloader.services.mozilla.com/builds/firefox-stub/en-US/win/c0c2728dec93a47f981393e20cb0793bafd3a455e152118836bde89b2f02b614/Firefox%20Installer.exe" -OutFile $Path\$Installer
Start-Process -FilePath $Path\$Installer -Args "/silent /install" -Verb RunAs -Wait
Remove-Item $Path\$Installer
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
"installed Firefox in $Elapsed sec"
exit 0 # successfully installed firefox
} catch {
"Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}