使用PowerShell获取Firefox的历史记录(places.sqlite)

时间:2019-05-10 12:39:18

标签: powershell

我需要Powershell脚本(或帮助)来从Mozilla Firefox中的place.sqlite导出数据。还可以从moz_historyvisits(从unixepoch到本地时间)进行DATE,将URL和TITLE(仅包含文本,无空白)从moz_places转换为带有; $分隔符(日期; $ url; $ title)的txt文件。 导出-每次启动Firefox时,都只会在txt文件((日期; $ url; $ title)中添加新行或缺少或删除的链接。谢谢。

1 个答案:

答案 0 :(得分:0)

这是将csv从sqlite传递到powershell的一种方法。您也可以通过Google在Powershell中加载sqlite库。 http://ramblingcookiemonster.github.io/SQLite-and-PowerShell/

sqlite3 -csv -header places.sqlite "select datetime(moz_historyvisits.visit_date/1000000, 'unixepoch', 'localtime') as datum, moz_places.url, moz_places.title from moz_places, moz_historyvisits where moz_places.id = moz_historyvisits.place_id and moz_places.title like '%' order by datum" |
  convertfrom-csv | select -last 3 | fl

datum : 2017-07-16 09:55:36
url   : http://www.microsoft.com/getsilverlight/get-started/install/default
title : Get Silverlight | Microsoft Silverlight

datum : 2017-07-16 09:55:57
url   : https://download.microsoft.com/download/0/3/E/03EB1393-4F4E-4191-8364-C641FAB20344/50901.00/Silverlight.dmg
title : Silverlight(1).dmg

datum : 2017-07-16 09:58:14
url   : https://channel9.msdn.com/Blogs/Charles/Scott-Hanselman-amp-Jeffrey-Snover-Discuss-Windows-PowerShell
title : Scott Hanselman & Jeffrey Snover Discuss Windows PowerShell | Charles | Channel 9