How to install Mozilla Firefox using Powershell

Estimated reading time: 1 min


In this article, you will learn how to install Mozilla Firefox using Powershell. Internet explorer is the preinstalled default browser provided by Microsoft. You can follow these easy steps to install Mozilla Firefox via Powershell. 


  • Windows OS (10 or server)
  • Powershell v4.0 or higher

Step 1: Open Powershell

Type in the search bar “Powershell” then press on the mouse right-click and select “Run as administrator” then click on “Yes”.

Powershell run as admin

Win powershell

Step 2: Powershell code

Copy the following code and paste it in Powershell then press Enter.

$workdir = "c:\installer\"

If (Test-Path -Path $workdir -PathType Container)
{ Write-Host "$workdir already exists" -ForegroundColor Red}
{ New-Item -Path $workdir  -ItemType directory }

$source = ""
$destination = "$workdir\firefox.exe"

if (Get-Command 'Invoke-Webrequest')
     Invoke-WebRequest $source -OutFile $destination
    $WebClient = New-Object System.Net.WebClient
    $webclient.DownloadFile($source, $destination)

Start-Process -FilePath "$workdir\firefox.exe" -ArgumentList "/S"

Start-Sleep -s 35

rm -Force $workdir/firefox*

Powershell code paste

Wait until the process is finished.

Powershell code finished


Congratulations, you have successfully installed Mozilla Firefox using Powershell

Was this article helpful?
Dislike 10
Views: 26392

Reader Interactions

Leave a Reply

Your email address will not be published. Required fields are marked *