Commit d4e5d7b9 authored by bobloblaw's avatar bobloblaw
Browse files

Updates powershell_scripting2.md

Auto commit by GitBook Editor
parent 180e1c95
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -13,19 +13,19 @@ $test = "something"

So for security reasons the default policy for executing scripts is **Restricted**. Here are the different script-policies.

```
Restricted. PowerShell won't run any scripts. This is PowerShell's default execution policy.

AllSigned. PowerShell will only run scripts that are signed with a digital signature. If you run a script signed by a publisher PowerShell hasn't seen before, PowerShell will ask whether you trust the script's publisher.
**Restricted**: PowerShell won't run any scripts. This is PowerShell's default execution policy.

RemoteSigned. PowerShell won't run scripts downloaded from the Internet unless they have a digital signature, but scripts not downloaded from the Internet will run without prompting. If a script has a digital signature, PowerShell will prompt you before it runs a script from a publisher it hasn't seen before.
**AllSigned**: PowerShell will only run scripts that are signed with a digital signature. If you run a script signed by a publisher PowerShell hasn't seen before, PowerShell will ask whether you trust the script's publisher.

**RemoteSigned**: PowerShell won't run scripts downloaded from the Internet unless they have a digital signature, but scripts not downloaded from the Internet will run without prompting. If a script has a digital signature, PowerShell will prompt you before it runs a script from a publisher it hasn't seen before.

**Unrestricted**: PowerShell ignores digital signatures but will still prompt you before running a script downloaded from the Internet.

Unrestricted. PowerShell ignores digital signatures but will still prompt you before running a script downloaded from the Internet.
```

Source: http://windowsitpro.com/powershell/running-powershell-scripts-easy-1-2-3

So if we want to run script **myscript.ps1** we have to set the execution-policy.
So if we want to run script `myscript.ps1` we have to set the execution-policy.
First let's check what execution-policy we currently have:

```