Unblock a file with PowerShell?

前端 未结 13 1799
野性不改
野性不改 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 02:59

    I haven't seen any answer yet that seems to use the proper powershell cmdlets to do this.

    Here we can find DLLs in the current folder that contain the zone.identifier:

    Get-Item -Path .\*.dll -stream * | where {$_.Stream -eq "Zone.Identifier" }
    

    Here we zap just only the unwanted streams, unlike some answers above that might damage other streams:

    Remove-Item  -Path .\*.dll -stream Zone.Identifier
    

提交回复
热议问题