General Information

Windows PowerShell Execution Policy

This section describes a few methods by that you can customize Windows PowerShell to best meet your needs. For complete details please refer to PowerShell reference documents.

Examine the Execution Policy

The Windows PowerShell execution policy determines whether scripts are allowed to run and, if they can run, whether they must be digitally signed. It also determines whether configuration files can be loaded.

The default execution policy, Restricted, is the most secure of the execution policies. It does not permit any scripts to run, and it does not permit any configuration files, including a Windows PowerShell profile, to be loaded. You can still use Windows PowerShell interactively. However, if you want to run scripts or load configuration files, you can change the execution policy on your system.

For information and instructions, type: get-help about_signing

To find the execution policy on your system, type: get-executionpolicy

To change the execution policy on your system, use the Set-ExecutionPolicy cmdlet. For example, to change the execution policy to RemoteSigned, type: set-executionpolicy remotesigned or Set-ExecutionPolicy Unrestricted

The Windows PowerShell execution policy is saved in the Windows registry and is retained even when you uninstall and reinstall Windows PowerShell.

Understanding the Profiles

You can have four different profiles in Windows PowerShell. The profiles are listed in load order. The most specific profiles have precedence over less specific profiles where they apply.

• %windir%\system32\WindowsPowerShell\v1.0\profile.ps1
This profile applies to all users and all shells.

• %windir%\system32\WindowsPowerShell\v1.0\ Microsoft.PowerShell_profile.ps1
This profile applies to all users, but only to the Microsoft.PowerShell shell.

• %UserProfile%\My Documents\WindowsPowerShell\profile.ps1
This profile applies only to the to the current user, but affects all shells.

• %UserProfile%\\My Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
This profile applies only to the current user and the Microsoft.PowerShell shell.


 Home       Contact Us
© 2009 DigiAce Enterprises Solutions