The file is not digitally signed. You can not run this script on this system.

Peter Kiers 91 Reputation points
2023-05-03T20:19:50.9533333+00:00

Dear experts,

I am using a Windows 11 pc. i have installed the software Visual Studio Code. Where i can give commands in PowerShell. I try to give the command: 'yo @microsoft/sharepoint". And i get the error message:

"File can not be loaded. The file is not digitallly signed. You can not run this script on the current system".

How can i solve this?

Gr. P

Windows for business | Windows Server | User experience | PowerShell
{count} votes

2 answers

Sort by: Most helpful
  1. Peter Kiers 91 Reputation points
    2023-05-03T21:09:45.13+00:00

    Got it :)

    On Windows 11 computers you can change the execution policy from Windows settings also.

    Open Settings → Privacy & Security → For developers

    Scroll down to the section PowerShell and click Apply. This will change the execution policy for the scope "CurrentUser" to "RemoteSigned". This change will allow local PowerShell scripts to run without signing.

    Gr. P

    4 people found this answer helpful.
    0 comments No comments

  2. Rich Matheisen 47,901 Reputation points
    2023-05-03T21:20:41.3033333+00:00

    Is "yo" a PowerShell script? Did you create the script "yo" on your machine? Is "yo" located on the local machine or on some other machine?

    Check the Execution policy on this machine (and for your user account by running this: Get-ExecutionPolicy.

    Also, see this: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-5.1

    The default execution policy on a Windows client machine is "Restricted". That prevents the running of any scripts.

    Changing the execution policy to "RemoteSigned" is usually a good choice (use the Set-ExecutionPolicy cmdlet to do that).

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.