Module cannot be loaded because running scripts is disabled on this system

Při spuštění příkazu se objeví chyba:
„… 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.“

Spusťte:

Get-ExecutionPolicy-List

Zobrazí se:

        Scope ExecutionPolicy
        ----- ---------------
MachinePolicy       Undefined
   UserPolicy       Undefined
      Process       Undefined
  CurrentUser       Undefined
 LocalMachine       Undefined

Spusťte:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine
Get-ExecutionPolicy -List

Výsledek by měl být:

        Scope ExecutionPolicy
        ----- ---------------
MachinePolicy       Undefined
   UserPolicy       Undefined
      Process       Undefined
  CurrentUser       Undefined
 LocalMachine    RemoteSigned