PSBrowserBookmarks

Status

Publishing: PowerShellGallery

Localization: en-US, de-DE.
These help pages will only be provided in English. Despite specifying the English dialect as en-US, british spelling may well be found, especially in help files.

Version: 0.6.6.0

Last commit: 2019-12-05

Limitations of the current release (instead of a ToDo pipeline)

These are known limitations and I am actively working on overcoming them:

  • Remove-* functions are not implemented yet. When implemented, those functions will accept and array of URIs from the pipeline.
  • only 64-bit OS support at this time. On 32-Bit Windows, you need to replace the SQLite DLL shipped with the module by its 32-Bit counterpart. This will be amended in the next release.
  • Favicons cache handling for Firefox and Chrome (currently the icons themselves are not written to the SQLite database so that all the bookmarks feature generic icons until their URLs have been opened at least once).
  • Multiple hierarchy roots in Firefox (currently only the Bookmarks bar is imported and exported) and Chrome (all roots are read as folders of the first order). The current idea is to add an additional ‘FolderRoot’ property to the BrowserBookmark object.
  • SQLite databases cannot be backed up if open by another program. Will use Backup API or VACUUM INTO.
  • Placeholder resolution in Chrome paths governed by Group Policy is not implemented yet (if Roaming Profile support is enabled, the module will look in %APPDATA%, otherwise in %APPDATALOCAL%, in the default subfolder).
  • Places path in Firefox that is set in settings.ini is not yet respected.
  • Order of bookmarks within the same folder (as maintained by Firefox and Chrome) is not yet respected
  • Built-in help content is missing for most functions. Writing it is a tedious process and much less fun than writing the actual code so please bear with me.

What it is

A PowerShell module for creating, importing and exporting bookmarks between major browsers. Imagine consolidating IE and Firefox bookmarks and adding them to Chrome. Or consolidating Chrome bookmarks from multiple user profiles. Or adding a set of bookmarks to all three browsers upon user profile creation.

For some background information on how bookmarks are stored by various browsers, see about_BrowserBookmarks.

Usage Examples

Insert a new bookmark into Firefox:

New-BrowserBookmark -Title "Some random page" -URL "https://random.pa.ge" | 
     Add-FirefoxBookmark -DefaultProfile

Types

BrowserBookmark

BookmarkOperationResult

Commands

New-BrowserBookmark

Get-FirefoxBookmarkLocation

Get-FirefoxBookmark

Add-FirefoxBookmark

Remove-FirefoxBookmark

Backup-FirefoxBookmark

Get-IEBookmarkLocation

Get-IEBookmark

Add-IEBookmark

Remove-IEBookmark

Backup-IEBookmark

Get-ChromeBookmarkLocation

Get-ChromeBookmark

Add-ChromeBookmark

Remove-ChromeBookmark

Backup-ChromeBookmark

Requirements

Windows PowerShell 5.x (uses classes, if there is a demand for the compatibility to earlier versions, please let me know).

SQLite library (.NET 4.0 binary from http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki). x64 version is shipped with the module.

The library requires the VC++ 2010 SP1 redistributable to be installed.

Helper functions not exported from the module

Get-IniContent (making heavy use of https://devblogs.microsoft.com/scripting/use-powershell-to-work-with-any-ini-file/)

ConvertFrom-MozillaTime

ConvertTo-MozillaTime

Get-MozillaHash (does nothing as of now, just returns zero)

Get-MozillaGUID (mocked, not really reverse-engineered, but Mozilla doesn’t seem to bother)

Get-MozillaURLMeta

ConvertTo-FileName

ConvertFrom-ChromeTime

ConvertTo-ChromeTime

Process-ChromeBookmarkBranch