Я не уверен, как бы вы хотели автоматизировать, но в PowerShell вы можете удалить файлы cookie Firefox, например:
if (Get-Process -Name firefox -ErrorAction SilentlyContinue) {
Write-Warning ("Firefox process(es) are still running. Please close all before removing the cookies.`r`n" +
"Use Get-Process -Name firefox -ErrorAction SilentlyContinue | Stop-Process -ErrorAction SilentlyContinue")
}
else {
$pathRoaming = "$($env:APPDATA)\Mozilla\Firefox\Profiles\*.default*"
if (Test-Path -Path $pathRoaming -PathType Container) {
$cookies = @()
foreach ($path in (Resolve-Path $pathRoaming)) {
$cookies += Get-ChildItem -Path $path -Filter 'cookies.sqlite*' -Recurse -Force -ErrorAction SilentlyContinue
}
# remove cookies.
$cookies | ForEach-Object { Remove-Item $_.FullName -Force -Recurse -ErrorAction SilentlyContinue -WhatIf }
}
}
Снимите переключатель -WhatIf
с командлета Remove-Item
, если вы удовлетворены результатами, показанными в консоли.
Надеюсь, что поможет