dvdende
Enthusiast
Enthusiast

Folder exclude with exception of specific folder

Hello,

We use the import/export code below to manage our Mozilla Firefox profile.
Since updating from .88 to .92 we are seeing our 2FA cookies land in the folder "<AppData>\Mozilla\Firefox\Profiles\[MATCHALL]\storage\default".

Now I want to include specific folders from that excluded folder so saved 2FA will be remembered across sessions. Seeing I only know the specific name of the folders I want to include, I tried mentioning them before and after the exclude using includefoldertrees and IncludeIndividualFolders but the exclude seems to always get precedence over the include lines.

The only other option I can think of is to write out all possible options but that means I have to write hundreds of lines to only include the four folders I want and to exclude everything else. Isn't there another option? A negate option of MATCHALLBUT would be lovely here. Hope someone can think of a better option than excluding every number/letter for every position other than the URL I want to include.

Current code without include for specific URL to include form default folder:

[IncludeRegistryTrees]
HKCU\Software\Mozilla
HKCU\Software\mozilla.org
HKCU\Software\MozillaPlugins

[IncludeFolderTrees]
<AppData>\Mozilla\Firefox

[ExcludeFolderTrees]
<AppData>\Mozilla\Firefox\Profiles\[MATCHALL]\storage\default\https+++[MATCHALL]
<AppData>\Mozilla\Firefox\Profiles\[MATCHALL]\storage\permanent
<AppData>\Mozilla\Firefox\Profiles\[MATCHALL]\storage\temporary

Thanks in advance,

Dominic

--EDIT-- I could use xcopy as a pre-export task to export the folders of the 4 URL's and then use Post-Import to put them back. But this all seems evenly excessive.

For now, until someone finds something better, I will be going the export and import task route.

Export ps1:

cd $env:APPDATA\Mozilla\Firefox\Profiles\*.default\storage\default

Copy-Item -Path *.companyName* -Destination $env:APPDATA\CompanyName\Firefox -Recurse

Import ps1:

cd $env:APPDATA\Mozilla\Firefox\Profiles\*.default\storage\default

Copy-Item -Path $env:APPDATA\CompanyName\Firefox\* . -Recurse

Reply
0 Kudos