Configuring the Scripting Policy

Since scripting in Windows PowerShell is not enabled by default, it is important to verify the level of scripting support provided on the platform before deployment of either scripts or commands. If you attempt to run a Windows PowerShell script when the support has not been enabled, you'll receive an error message and the script won't run. This error message is shown in Figure 2-1.

Attempting to run a script before scripting support is enabled generates an error.

Figure 2-1. Attempting to run a script before scripting support is enabled generates an error.

This is referred to as the restricted execution policy. There are four levels of execution policy that can be configured in Windows PowerShell ...

Get Windows PowerShell™ Scripting Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.