Microsoft says Windows PowerShell now warns when running scripts that use the Invoke-WebRequest cmdlet to download web content,
aiming to prevent potentially risky code from executing.
The warning has been added to Windows PowerShell 5.1, the PowerShell version installed by default on Windows 10 and Windows 11 systems, and is designed to add the same secure web parsing process available in PowerShell 7.
PowerShell will alert you that, without precautions,
scripts contained in web pages downloaded using the "Invoke-WebRequest' cmdlet could execute on your system. By default, if you press 'Enter' or select 'No,' the operation will be canceled, and PowerShell will suggest rerunning the command with the '-UseBasicParsing' parameter for safer processing.
When choosing 'Yes,' PowerShell will parse the page using the older method (full HTML parsing), allowing the content and embedded scripts to load as before. In short,
selecting 'Yes 'means you accept the risk, while choosing 'No' stops the action to protect your system.
Microsoft says Windows PowerShell now warns when running scripts that use the Invoke-WebRequest cmdlet to download web content, aiming to prevent potentially risky code from executing.
www.bleepingcomputer.com