Let's say we have a hello.zip archive containing a hello.ps1 file. My question isn't specific to PowerShell, I'm merely using a PowerShell script as an example.

  1. Upload hello.zip to a server.
  2. Download hello.zip
  3. Recent versions of Windows will mark the file as unsafe and block it (right-click -> Properties.

If I now uncompress hello.zip from the shell (right-click -> Extract All... or similar), the extracted files will carry over the blocking. If, however, the extraction happens from the command line, the uncompressed files will be unblocked.

In the case of the script above —with a RemoteSigned execution policy in place for PowerShell—, in the first case the script will be unable to run, whilst in the second it will execute normally.

I would like to understand why the blocking works differently depending on how the archive is uncompressed.

link|improve this question

feedback

1 Answer

It's possible that you found a bug.

But it most likely is "by design" since so much uncompressing goes on by command line in the background and during installations of some apps, that having those blocked, too, could lead to problems for the uninitiated and wasted time for the initiated. Certainly administrators would not want to deal with it, and normal users would not be using a command line to open them in the first place.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.