Setting up PowerShell for SharePoint :
PowerShell is setup by default. You will not be able to run a script right off the bat.Because Microsoft set the default security level to not allow this behavior.
This is useful because it helps to prevent security issues, and in general practice, it limits the possibility that a beginner makes a serious mistake.
PowerShell can be very unforgiving. Once a process is started, it is all but impossible to stop it. So be sure to test everything you write thoroughly before executing in a production environment.
Microsoft's new name for PowerShell bundled with Windows Remote Management (WinRM) 2.0 and Background Intelligent Transfer Service (BITS) 4.0, is called.
get-executionpolicy
set-executionpolicy
- Restricted: Does not load configuration files or run scripts. "Restricted" is the default.
- AllSigned: Requires that all scripts and configuration files be signed by a trusted publisher, including scripts that you write on the local computer.
- RemoteSigned: Requires that all scripts and configuration files downloaded from the Internet be signed by a trusted publisher.
- Unrestricted: Loads all configuration files and runs all scripts. If you run an unsigned script that was downloaded from the Internet, you are prompted for permission before it runs.
- Bypass: Nothing is blocked and there are no warnings or prompts.
- Undefined: Removes the currently assigned execution policy from the current scope. This parameter will not remove an execution policy that is set in a Group Policy scope.