How to ‘Unblock’ PowerShell files

Frustrated by the warning message on Windows computers “This file came from another computer and might be blocked to help protect this computer“? The warning appears when you try to open a PowerShell file that has come from a 3rd party.

Check Security section

Right-click on a single file and choose Properties and look for the Security section at the bottom of the window:

“This file came from another computer and might be blocked to help protect this computer.”

You can check the box (in Windows 10) or click the Unblock button (in Windows 7/8) to unblock the file.

Unblock multiple files

If you have multiple files and are unable to select them all at once, you will need to manage each file separately to unblock them. If the files were supplied in a ZIP file, make sure you always unblock the ZIP file before extracting the files.

Unblock multiple files with PowerShell

If you have multiple files an alternative is to run the following PowerShell:

dir -Path [directory path] -Recurse | Unblock-File

Note: Don’t forget to replace [directory path].

, , ,


Recent Posts

  • How to Add and Remove Accounts from Multi-Select SharePoint Person and Group Fields
    Learn how to use the SharePoint API and Power Automate to add and remove accounts from multi-select Person and Group fields in SharePoint. Our step-by-step guide includes detailed illustrations and examples, as well as an optional Power Platform solution to help you deploy the solution to your tenant. Improve your SharePoint workflow management today!
  • Navigating Microsoft Power Automate Licensing: Challenges, Considerations, and Compliance
    Navigate the complexities of Microsoft Power Automate licensing with insights on challenges, considerations, and compliance. Learn about potential risks, licensing rules, and best practices for organizations using Power Automate. Get guidance on avoiding license breaches, managing premium connectors, and ensuring compliance with Microsoft licensing requirements. Stay informed and take proactive steps to maintain licensing compliance in Power Automate, regardless of your location. Discover practical strategies to optimize your Power Automate licensing and avoid potential pitfalls.
  • SharePoint REST API: How to find the List or Library “__metadata” “type”
    SharePoint REST API is a powerful tool for updating lists and items in SharePoint, but determining the correct “__metadata” “type” for API calls can be confusing. While it’s typically “SP.Data.ListNameItem” based on the list’s URL, there are cases where it may be “SP.Data.ListNameListItem” in certain Office 365 tenants. In this article, we will explore how to find the correct “__metadata” “type” when updating lists or libraries in SharePoint, and also highlight the alternative approach of using the Microsoft Graph API. By understanding this crucial aspect of SharePoint REST API, readers can ensure successful updates and avoid potential errors.
  • “The Age of #AI has begun” said Bill Gates
    March 2023 has been an extraordinary month with the launch of GPT-4 on March 14th, closely followed by #Microsoft’s launch of Copilot preview on March 16th, and Bill Gates’ article, “The Age of AI has begun,” on March 21st.
  • Error Handling using a Power Automate Child Flow
    In the context of an article, I wrote; I was asked if I had intended for the error handling steps to be encapsulated within a ‘Child Flow’. I scratched my head and replied what a good idea!
%d bloggers like this: