In our environment we had folder redirection on by GPO and when I would open PowerShell I would get this Security Warning error.
Security warning
Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your computer. If you trust this
script, use the Unblock-File cmdlet to allow the script to run without this warning message. Do you want to run ?
[D] Do not run [R] Run once [S] Suspend [?] Help (default is “D”):
After doing a lot of research I found these solutions:
Without a GPO:
Configure Network Share as a Trusted Zone (for network scripts):
Control Panel > Internet Options: Open Internet Options, navigate to the “Security” tab, and add the network share (e.g., \\networkshare
) to the “Local intranet” security zone.
Add to Trusted Sites: Alternatively, you can add the network share to the trusted sites list using the file://
protocol (e.g., file://\\networkshare
). I did this option in our GPO
With GPO:
I added the fqdn of the server that my profile was being redirected to under:
Computer Configuration > Policies > Administrative Templates > Windows Components > Internet Explorer > Internet Control Panel > Security Page
Enable Site to Zone Assignment List
Add:
Value name: file://server_fqdn
Value: 1
Then open command prompt and run gpupdate /force and reopen PowerShell. Popup should disappear