Created
September 1, 2019 22:44
-
-
Save sdovnic/9d4c158b23f2fefdec4bbe03846cbebb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$MozillaId = ((Get-Item -Path "HKLM:\\SOFTWARE\Classes\FirefoxHTML-*" | Select-Object -Property Name -First 1).Name).Split("-")[1] | |
$InstallsFile = Get-Content -Path $env:APPDATA\Mozilla\Firefox\installs.ini | |
$InstallsMatch = $InstallsFile -match "\[(.*)\]" | |
if ($InstallsMatch -ne ("[{0}]" -f $MozillaId)) { | |
$false | |
("[{0}]" -f $MozillaId) | |
$InstallsMatch | |
} else { | |
$InstallsFile -replace "\[(.*)\]", ("[{0}]" -f $MozillaId) | Set-Content -Path $env:APPDATA\Mozilla\Firefox\installs.ini | |
} | |
$ProfilesFile = Get-Content -Path $env:APPDATA\Mozilla\Firefox\profiles.ini | |
$ProfilesMatch = $ProfilesFile -match "\[Install(.*)\]" | |
if ($ProfilesMatch -ne ("[Install{0}]" -f $MozillaId)) { | |
$false | |
("[Install{0}]" -f $MozillaId) | |
$ProfilesMatch | |
} else { | |
$ProfilesFile -replace "\[Install(.*)\]", ("[Install{0}]" -f $MozillaId) | Set-Content -Path $env:APPDATA\Mozilla\Firefox\profiles.ini | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment