Will PowerShell 5.1 Require Confirmation for Invoke-WebRequest?

0
9
Asked By CleverPanda25 On

I'm curious if I've got this right: Is Windows PowerShell 5.1 going to implement a mandatory user confirmation for any script that utilizes Invoke-WebRequest without the -UseBasicParsing flag? I came across a news article discussing this change and wanted to confirm if it's accurate. Any insights would be appreciated!

2 Answers

Answered By JediCoder99 On

Exactly! It's a much-needed measure to reduce the risk of running potentially harmful scripts. Honestly, it's going to force a lot of people to double-check what they’re executing, which is a good thing! But yeah, it will slow down scripts that haven't been updated.

Answered By TechScribe42 On

Yes, it looks like you’re right! Starting with the latest updates, PowerShell will indeed require confirmation for scripts using Invoke-WebRequest unless you specify -UseBasicParsing. This should help avoid mistakes made by running unverified scripts from the web. I've also decided to add `UseBasicParsing` to our `$PSDefaultParameterValues` to make our scripts safer. By the way, here’s a link to the official Microsoft announcement if you want more details: [Microsoft Announcement](https://support.microsoft.com/en-us/topic/powershell-5-1-preventing-script-execution-from-web-content-7cb95559-655e-43fd-a8bd-ceef2406b705).

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.