When trying to run an Invoke-WebRequest in PowerShell, it takes absolutely ages to do anything and then I get a message saying "A script on this page is causing your web browser to run slowly". I wouldn't mind too much, but this is for a auto recurring script which will be unattended and the popup requires the user to pick yes or no.
I've tried -UseBasicParsing but which fixes the speed issue, but for the purpose of the script, I need the HTML parsed.
If I load the website in a normal browser I don't get any issues and I can't find anything that's running slowly on the page.
Is there any way to get it to ignore the scripts when using Invoke-WebRequest as I'm only really interested in the contents of a table on the webpage.
Here's the actual command with URL so you can see if you get the same result:
Invoke-WebRequest https://learn.microsoft.com/en-us/azure/active-directory/enterprise-users/licensing-service-plan-reference
Any help would be appreciated as I'm totally stuck for ideas at the moment!