Error – To allow this website to provide information personalized for you, will youallow it to put a small file (called a cookie) on your computer?”
Problem -> Whenever we use powershell “Invoke-WebRequest” command to access website with cookies then its gives warning as below:
powershell> Invoke-WebRequest http://microsoft.com
Warning:
“To Allow this website to provide information personalized for you, will you allow it to put a small file (cookie) on your computer?”
Solution ->
Solution 1 – Windows 8.1 there was a workaround. If you went into: Control Panel > Internet Options > Privacy, there was a slider you could turn all the way down to allow ALL cookies.
Solution 2 – you can use “-UseBasicParsing” in “Invoke-WebRequest” command in case you dont want to use advance options like “ParsedHtml.getElementsByTagName ”
Invoke-WebRequest http://microsoft.com -UseBasicParsing
Solution 3 – one more workaround as below:
open powershell with “run as administrator” and run below command to add reg key:
reg add “HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3” /t REG_DWORD /v 1A10 /f /d 0
Then close your PowerShell session, re-open it, and try.