2 0

Export Chrome History

# Set variables
$DownloadPath = "C:\Users\Public\Downloads"
$Link = "https://www.nirsoft.net/utils/chromehistoryview.zip"
$File = "chromehistoryview.zip"
$InstallFile = "ChromeHistoryView.exe"

# Download
$ProgressPreference = "SilentlyContinue"
if (Test-Path $DownloadPath\$File) {
  Remove-Item $DownloadPath\$File
}
Invoke-WebRequest -Uri $Link -OutFile $DownloadPath\$File -UseBasicParsing

# Extract
if (Test-Path $DownloadPath\$InstallFile) {
  Remove-Item $DownloadPath\$InstallFile
}
Expand-Archive $DownloadPath\$File $DownloadPath

# Install to UpdatePath
Start-Process -FilePath "$DownloadPath\$InstallFile" -ArgumentList "/UseHistoryFile 1","/HistoryFile `"C:\Users\username\AppData\Local\Google\Chrome\User Data\Default\History`"","/scomma c:\ChromeHistoryView.csv"