Was it just to prevent accidental script execution?
It is ABSOLUTELY NOT a security mechanism. That is why we we support this:
Set-ExecutionPolicy -ExecutionPolicy Bypass
I wanted to make it:
Set-ExecutionPolicy -ExecutionPolicy DoAnythingBecauseTExecutionPolicyIsNOTASecurityFeature
But the team didn't like that. (I should have overruled them on that one :-) ).
Jeffrey Snover [MSFT]
Also, I might not want every script to be executable. With Unix I can choose which ones are executable and by whom. With PS it's all or nothing. :/
Try doing a: Get-ExecutionPolicy -List to see what is setting it.
Then use -SCOPE on Set-ExecutionPolicy.
BTW - I hear you on the "only chmod the scripts you want" - that is a nice benefit of the Unix model.
Jeffrey Snover [MSFT]
In Unix, you have to chmod a+x a file before running it. And you have to do it for every script you want to run.
So to run 1 cmdlet to enable all scripts seems a bargain. (Honestly I could be missing something and I probably am because you are not the first person to mention it. I just can't connect the dots.)
Jeffrey Snover [MSFT]