Set-ExecutionPolicy RemoteSigned $cookieLocation = 'C:\Users\jonas\AppData\Local\Google\Chrome\User Data\Default\cookies' $tempFileName = [System.IO.Path]::GetTempFileName() "select writefile('$tempFileName', encrypted_value) from cookies where host_key = '.facebook.com' and path = '/' and name = 'xs';" | C:\Users\jonas\Desktop\cookies\sqlite3.exe "$cookieLocation" $cookieAsEncryptedBytes = Get-Content -Encoding Byte "$tempFileName" Remove-Item "$tempFileName" Add-Type -AssemblyName System.Security $cookieAsBytes = [System.Security.Cryptography.ProtectedData]::Unprotect($cookieAsEncryptedBytes, $null, [System.Security.Cryptography.DataProtectionScope]::CurrentUser) $cookie = [System.Text.Encoding]::ASCII.GetString($cookieAsBytes) $cookie | Out-File -filepath C:\Users\jonas\Desktop\cookies\export.txt