Introduction
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.
Prerequisites
- 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”.
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} ELSE { New-Item -Path $workdir -ItemType directory } $source = "https://download.mozilla.org/?product=firefox-latest&os=win64&lang=en-US" $destination = "$workdir\firefox.exe" if (Get-Command 'Invoke-Webrequest') { Invoke-WebRequest $source -OutFile $destination } else { $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*
Wait until the process is finished.
Conclusion
Congratulations, you have successfully installed Mozilla Firefox using Powershell
Leave a Reply