Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Block a file with Powershell

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.

like image 857
SFun28 Avatar asked Jan 02 '23 14:01

SFun28


1 Answers

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
like image 97
Nacimota Avatar answered Jan 09 '23 19:01

Nacimota