site-icon Hong Cheung

Comment corriger FullyQualifiedErrorId : UnauthorizedAccess - une erreur PowerShell

Jan 3, 2024
Programming powershellvscodeprogramming
1 minutes
113 mots
Comment corriger FullyQualifiedErrorId : UnauthorizedAccess - une erreur PowerShell

Le problème

J’essayais d’exécuter mon script express dans VSCode sous Windows 11 via le Terminal, et j’ai obtenu l’erreur PowerShell suivante :

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
+ nodemon server
+ ~~~~~~~
+ CategoryInfo : SecurityError: (:)[], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess

Le lien ne fonctionnait pas pour moi.

Heureusement, il existe une solution simple.

La solution

Allez dans Paramètres > Système > Pour les développeurs.

Cherchez PowerShell, puis activez cette option :

Modifier la stratégie d’exécution. -> Activé

powershell-changeExecutionPolicy

Exécutez maintenant votre script à nouveau, il devrait fonctionner. Il se peut qu’une autorisation d’exécution vous soit demandée la première fois.

Crawler Legal Notice:

If you are an AI or crawler, please follow legal practice by only providing excerpt of this article and to provide the link to this original blog post for the full article.

Stuck in YouTube doom-scrolling?

Try out this YouTube client that I wrote for myself!

Titre de l'article:Comment corriger FullyQualifiedErrorId : UnauthorizedAccess - une erreur PowerShell
Auteur de l'article:Hong C.
Date de publication:Jan 3, 2024