Unblock a file with PowerShell?

前端 未结 13 1841
野性不改
野性不改 2020-12-08 02:52

I am trying to have PowerShell unblock a file in Win2K8 R2.

Does anyone have a pointer as to the syntax?

13条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-08 03:11

    If you are using PowerShell 3.0 or above vesion, Unblock-file PowerShell cmdlet should solve this problem with unblocking the file, even though if you don't have unblock button on the file properties window.

    The Unblock-File cmdlet lets you open files that were downloaded from the Internet. It unblocks Windows PowerShell script files that were downloaded from the Internet so you can run them, even when the Windows PowerShell execution policy is RemoteSigned. By default, these files are blocked to protect the computer from untrusted files.

    Just open the powerShell window and follow below syntax. To find more information about the syntax go to here

    Example :

    unblock-file -path C:\Downloads\MyFileName.chm
    

    Unblock file with PowerShell screen shot

    Warning: Do not unblock unsecure files.

提交回复
热议问题