The shell is, by default, a secure environment. If history is any guide, then we know that executing scripts can be dangerous; therefore, by default, scripts are not enabled for execution. Also, there is no extension mapping that will allow you to run a script by double-clicking on it from the Windows Explorer. Before enabling scripts for execution, be sure to consider the risks associated with running scripts.
To enable scripts for execution, enter the following command at the shell prompt:
PS> set-executionpolicy allsigned
This command sets the execution policy to require that all scripts must have a trusted signature to execute. If you would like a less restrictive environment, you can enter the following command:
PS> set-executionpolicy remotesigned
This command indicates that the shell will execute scripts downloaded from the web only if they are signed by a trusted source. The least secure execution policy may be set as follows:
PS> set-executionpolicy unrestricted
This command sets the execution policy to run scripts regardless of whether they have a digital signature.
Also, it is important to note that the current directory may not be part of the path. If you wish to run a script that is not in a directory that is part of the path, you must first use "./" when you specify the script at the command prompt: