Question: When starting a PowerShell host (powershell.exe, PowerShellISE, NuGet Package Manager Console etc) I was getting the following error message.

> 
> File C:\Users\MyUserName\Documents\WindowsPowerShell\profile.ps1
>  cannot be loaded because its operation is blocked by software
>  restriction policies. For more information, contact your system
>  administrator.
> 
> 
> 

This was particularly problematic in the case of the NuGet Package Manager Console as the console was left in a disabled / unusable state after the error. Other PowerShell hosts could at least be used.

I had problems a few weeks ago, when setting up my workstation at a new job, because a Group Policy setting was applying a *MachinePolicy* of *AllSigned*. That issue had been resolved by changing the setting to *RemoteSigned*. I checked that this setting is still in place using the command:

```
Get-ExecutionPolicy -List

```

I also confirmed that this **$profile.CurrentUserAllHosts** file exists but my Internet searches for another *"Group Policy setting"* revealed nothing of interest. My PowerShell version information is:

```
$PSVersionTable

Name                           Value
----                           -----
PSVersion                      3.0
WSManStackVersion              3.0
SerializationVersion           1.1.0.1
CLRVersion                     4.0.30319.18408
BuildVersion                   6.2.8370.0
PSCompatibleVersions           {1.0, 2.0, 3.0}
PSRemotingProtocolVersion      2.2

```

Answer: 
If I **delete or move** the problem profile script then all of my PowerShell hosts start without errors, including the PowerShell ISE which was using it's own *Current User Current Host* script C:\Users\MyUserName\Documents\WindowsPowerShell\Microsoft.PowerShellISE\_profile.ps1

It turns out that the problem with my All Hosts profile script was that it was ***completely empty***! Adding any content into the file, even a single space character or comment, allowed this profile script to be *executed* by all of the various PowerShell hosts. I must have cleared out the contents of this script at some point, instead of deleting it.

Not exactly an intuitive error message which is why I'm posting this Q&A style entry for future reference.

Interestingly, I am able to *execute* empty / blank scripts in all hosts after they have started and this problem seems to be specific to profile scripts.
Actually, that looks like AppLocker error message. Some information about it can be found [here](http://jamessql.blogspot.nl/2013/04/limit-running-powershell-script-under.html) (however author is doing reverse - he tries to limit script usage).

If other profiles work (other than profile.ps1) that it may be just a deny rule.