Zend certified PHP/Magento developer

How to stop cookie prompt while using Invoke-WebRequest in PowerShell

I have a script that uses Invoke-WebRequest. It has worked fine until yesterday when it pauses for a prompt to accept cookies in a window button.

$webpage = Invoke-WebRequest -SessionVariable session "https://www.decades.com/schedule"

enter image description here

I have since:

  • Added -SessionVariable session to the request – no change
  • Checked IE security level – looked usual

enter image description here

  • IE Privacy Settings were/are set to Accept

enter image description here

  • I could not reproduce the message by manually placing the
    command line in a manual PowerShell session

I, to my knowledge:

  • Do not have Internet Explorer installed (not in Apps list)
  • Have not made any settings changes to any Internet Explorer or Edge

Thanks

Windows 10 Pro; PowerShell v5.1