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. 回答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 来源: