Table of Contents
Installing the Mozilla Firefox
Would you like to learn how to install Mozilla Firefox using Powershell? In this tutorial, we are going to show you how to use Powershell to install Mozilla Firefox on a computer running Windows.
- Create a temporary directory to store Mozilla Firefox.
- Download the Mozilla Firefox installer.
- Perform a silent installation of Mozilla Firefox.
Full script to download and install Mozilla Firefox using a PowerShell.
#Create a temporary directory to store Mozilla Firefox.
md -Path $env:temp\firefoxinstall -erroraction SilentlyContinue | Out-Null
#Download the Mozilla Firefox installer.
$Download = join-path $env:temp\firefoxinstall firefox_installer.exe
Invoke-WebRequest 'https://download.mozilla.org/?product=firefox-latest&os=win64&lang=en-US' -OutFile $Download
#Perform a silent installation of Mozilla Firefox.
Invoke-Expression "$Download /S"
Verify the installation of Mozilla Firefox.
$INSTALLED = Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate
$INSTALLED += Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate
$INSTALLED | ?{ $_.DisplayName -match 'firefox' } | sort-object -Property DisplayName -Unique | Format-Table -AutoSize
Here is the command output. Congratulations! You are able to install Mozilla Firefox using PowerShell.
DisplayName DisplayVersion Publisher InstallDate
----------- -------------- --------- -----------
Mozilla Firefox (x64 en-US) 103.0.1 Mozilla
If your Windows running an older PowerShell versions, let’s using the following script to download and install the latest version of Mozilla Firefox.
#Create a temporary directory to store Mozilla Firefox.
md -Path $env:temp\firefoxinstall -erroraction SilentlyContinue | Out-Null
#Download the Mozilla Firefox installer.
$Download = join-path $env:temp\firefoxinstall firefox_installer.exe
(new-object System.Net.WebClient).DownloadFile('https://download.mozilla.org/?product=firefox-latest&os=win64&lang=en-US',$Download)
#Perform a silent installation of Mozilla Firefox.
Invoke-Expression "$Download /S"
5/5 - (4 votes)