Skip to content

Instantly share code, notes, and snippets.

@jonimattila
Created February 22, 2018 10:31
Show Gist options
  • Save jonimattila/e6516adf1eaa43dfcf5fdd8b910bac6a to your computer and use it in GitHub Desktop.
Save jonimattila/e6516adf1eaa43dfcf5fdd8b910bac6a to your computer and use it in GitHub Desktop.
Firefox uninstall and install script to be used with psappdeploytoolkit
#Remove from user folder
$UserDir = "C:\Users"
$Folders = Get-ChildItem -Path $UserDir
ForEach ($Folder in $Folders)
{
if (Test-Path "$Userdir\$folder\AppData\Local\Mozilla Firefox\uninstall\helper.exe")
{
Execute-Process -Path "$Userdir\$folder\AppData\Local\Mozilla Firefox\uninstall\helper.exe" -Parameters '-ms' -ContinueOnError $True
}
}
#Remove from Program Files
if (Test-Path "${env:ProgramFiles(x86)}\Mozilla Firefox\uninstall\helper.exe")
{Execute-Process -Path "${env:ProgramFiles(x86)}\Mozilla Firefox\uninstall\helper.exe" -Parameters '-ms' -ContinueOnError $True}
if (Test-Path "${env:ProgramFiles}\Mozilla Firefox\uninstall\helper.exe")
{Execute-Process -Path "${env:ProgramFiles}\Mozilla Firefox\uninstall\helper.exe" -Parameters '-ms' -ContinueOnError $True}
#Install
Execute-Process -Path "$dirfiles\Firefox Setup 58.0.2.exe" -Parameters '-ms' -ContinueOnError $True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment