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: 
Delete both files

```
C:\Users\MyUserName\Documents\WindowsPowerShell\Microsoft.PowerShellISE_profile.ps1
C:\Users\MyUserName\Documents\WindowsPowerShell\profile.ps1

```
I want to use the defualt profile, but I got a same question.

I have changed the executionplicy to solve the problem.

```
Set-ExecutionPolicy Unrestricted

```

[link]
<https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.security/set-executionpolicy?view=powershell-7.2>

<https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.2>