To be completely honest, I used to run
POWERSHELL scripts without giving it much thought about where they originated from. So when I saw this recent update, my first thought was "kudos to MS".
PowerShell now warns you when you attempt to execute script that has been downloaded off the net. This modification is a lot more better feature than before.
What Changed with PowerShell?
Microsoft has developed
PowerShell to include a notification when you run the Command
"Invoke-WebRequest" to download files or scripts. This warning will inform the user, if a file/script is potentially harmful,
BEFORE the
script/file is executed.
While the
Script would still be executed,
Microsoft now allows the user to contemplate whether or not to execute it. That small amount of time should give the user an opportunity to reflect on whether to execute the Script or not.
Why Did Microsoft Create This Notification?
The Command
"Invoke-WebRequest", was frequently used by Hackers as a tool to "stealth" download a malicious file to your computer. I have witnessed many occasions, where one small command resulted in disastrous results.
Thus, Microsoft created the Notification to:
- Assist users in identifying risky scripts/files
- Minimise accidental downloads of malicious files
- Protect user systems without limiting regular business operations
How Does This Assist You?
The notification gives you the decision of whether or not to execute a particular
file/script. If you feel comfortable with what you have downloaded and/or running, then you can proceed forward with execution. If not, you are able to stop.
This update benefits both the novice and the expert user of PowerShell. It maintains the flexibility of PowerShell and does not cause any inconsistencies with existing scripts, thus achieving a good balance.
What Happens When You Ignore A Warning Message?
If you feel comfortable trusting the source of the script, you may proceed with executing the script.
PowerShell will not prevent execution of the script, however, doing so will increase the possibility of a user becoming a victim of a hacker's attack due to hackers depending on users clicking on "yes" without fully assessing the situation. Users have likely experienced this by accidentally executing a command that they later regretted. This feature will help reduce the chance of making an error in judgment.