Running Powershell files downloaded from the internet


Author
Message
RayG
RayG
Advanced Member
Advanced Member (554 reputation)Advanced Member (554 reputation)Advanced Member (554 reputation)Advanced Member (554 reputation)Advanced Member (554 reputation)Advanced Member (554 reputation)Advanced Member (554 reputation)Advanced Member (554 reputation)Advanced Member (554 reputation)
Group: Forum Members
Posts: 277, Visits: 1.3K

To protect you from dangerous scripts downloaded from the internet, Powershell blocks all such files from running. Having inspected a file to ensure it is safe to use and is not going to do anything malicious to your system you can unblock it. Use one of the following methods:

This can be done in the following way:
Open the file properties and pop a checkmark in the "Unblock" box, Apply and OK

http://forum.macrium.com/uploads/images/7da3ccb0-42c6-45a7-a838-b008.png

or...
You can unblock a file from Powershell:
get-childitem -path "D:\<your path>\*.ps1" |unblock-file -WhatIf

It will show you what would be unblocked and if you wantit to carry out the command just remove the "-WhatIf"

More information here:
https://technet.microsoft.com/en-us/library/hh849924%28v=wps.630%29.aspx
https://technet.microsoft.com/en-us/library/hh847748%28v=wps.630%29.aspx
If you have subdirectories you can add the"-recurse" option:

get-childitem -path "D:\Reflect\*.ps1" -recurse| unblock-file -WhatIf



Regards
RayG
Windows10 Pro X64 V1809 B17763.194 MR v7.2.3906

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search