Found this issue when trying to install a PowerShell script on my home PC
PS C:\WINDOWS\system32> Import-Module ACMESharp
[Import-Module : File C:\Program Files\WindowsPowerShell\Modules\ACMESharp\0.9.1.326\ACMESharp-Extensions\ACMESharp-Extensions.psm1 cannot be loaded because running
scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ Import-Module ACMESharp
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [Import-Module], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess,Microsoft.PowerShell.Commands.ImportModuleCommand]
Luckily the solution was a simple one. There's a one-liner that will set the execution policy of a specified user. In this case, I wanted to set it to unrestricted:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted
And that was enough! Thought it was worth putting here. I've googled this error a dozen times and forgotten the solution every time.