Install-Firefox
Installs Mozilla Firefox
#requires -version 5.1
try {
$stopWatch = [system.diagnostics.stopwatch]::startNew()
"? Installing Mozilla Firefox from Microsoft Store..."
& winget install --id 9NZVDKPMR9RD --source msstore --accept-package-agreements --accept-source-agreements
if ($lastExitCode -ne 0) { throw "Can't install Mozilla Firefox, is it already installed?" }
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds
"? Mozilla Firefox installed successfully in $($elapsed)s."
exit 0 # success
} catch {
"?? ERROR: $($Error[0]) (script line $($_.InvocationInfo.ScriptLineNumber))"
exit 1
}This script has no configurable parameters.