VMware : PowerShell execution policy of this computer is not set to RemoteSigned

By | April 6, 2013

You might get this message launching VMware vSphere PowerCLI on your Windows workstation :

The PowerShell execution policy of this computer is not set to “RemoteSigned”. This prevents execution of PowerShell scripts on your computer and will result in errors when VMware vSphere PowerCLI is invoked. It is recommended that you set the execution policy to “RemoteSigned” in order to be able to execute scripts. This can be done by invoking the command ‘Set-ExecutionPolicy RemoteSigned’ from a PowerShell prompt.

As you’ve been told by the message itself, you simply need to open up a PowerShell command prompt :

Start > All Programs > Accessories > Windows PowerShell

And type the following command :

Set-ExecutionPolicy RemoteSigned

(and press Y to accept the change)

If you want to check out the current setting for ExecutionPolicy, simply do :

Get-ExecutionPolicy

Here is some explanation about the possible choices :

Restricted – Scripts won’t run.
RemoteSigned – Scripts created locally will run, but those downloaded from the Internet will not (unless they are digitally signed by a trusted publisher).
AllSigned – Scripts will run only if they have been signed by a trusted publisher.
Unrestricted – Scripts will run regardless of where they have come from and whether they are signed.

To set any of those, just do :

Set-ExecutionPolicy <policy_name>