Block a file with Powershell

↘锁芯ラ 提交于 2020-03-04 05:41:29

问题


I want to block (not unblock) a file with Powershell. I want to cause Windows to believe that a file on disk was downloaded from the internet, or whatever other scenario exists such that files become blocked. I need this to test how some software I'm developing behaves in the presence of a blocked file.


回答1:


If you're just trying to add the zone identifier you could try something like this:

$data = "[ZoneTransfer]
ZoneId=3"

Set-Content example.txt -Stream "Zone.Identifier" -Value $data


来源:https://stackoverflow.com/questions/49583470/block-a-file-with-powershell

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!