Date:

Share:

Angular PowerShell ng.ps1 Can Not be Loaded and Not Digitally signed

Related Articles

In this article, I am going to explain how to fix the error C: Users admin AppData Roaming npm ng.ps1 file is not digitally signed.

I am working with an Angular app and most recently when I assembled and ran my Angular app using ng s –open Powershell command, I got the following error:

ng: File C: UsersadminAppDataRoamingnpmng.ps1 cannot be loaded.The file C: UsersadminAppDataRoamingnpmng.ps1 is not digitally signed.
You cannot run this script on the current system.
For more information about running scripts and setting execution policy,
see about_Execution_Policies at https: /go.microsoft.com/fwlink /? LinkID = 135170.
At line: 1 char: 1
   + ng s--open
   + ~~
   + CategoryInfo          : SecurityError: (:)[], PSSecurityException
   + FullyQualifiedErrorId : UnauthorizedAccess

This error indicates that your device prevents you from executing or running the script files. These regulations are implemented in Windows systems including Windows client computers or Windows Server.

PowerShell has the following execution policies, andDesign and configuration files That have a file extension (.ps1xml), Module scripts Having (.psm1) file extension and PowerShell profiles There is a file extension (.ps1).

I searched for many solutions for it through the internet but most of the solutions did not work for me and finally, I got the solution to fix this error that I wanted to share with you. You can perform the data steps to correct the angular PowerShell error.

In my previous articles, I explained many topics about creating an angular project, angled graphic, angled charts, angled with bootstrap, angularJS, uploading Microsoft Excel, etc., that you might want to read.

Implementation

So let’s start with a solution to this error.

Level 1: Open the PowerShell window with administrative privileges, and then follow the command prompt.

Get-ExecutionPolicy -List
PowerShell-ExecutionPolicy

As can be seen in the list of implementation policies, there are a Current user Marked approx Not set In addition to LocalMachine It is set to limited, So we need to fix that and mark them as AllSigned.

level2: Now, execute the following command in the PowerShell window.

Set-ExecutionPolicy -ExecutionPolicy AllSigned -Scope CurrentUser
PowerShell-ExecutionPolicy-CurrentUser
Set-ExecutionPolicy -ExecutionPolicy AllSigned -Scope LocalMachine
PowerShell-ExecutionPolicy-LocalMachine

Step 3: When you execute the following command again, you can see the Current user and LocalMachine Marked approx AllSigned And the problem was solved. You can now run your angular application without any error.

PowerShell ExecutionPolicy

Summary

In this article we have learned, the way to fix PowerShell ng.ps1 can not be loaded and digital-related error for angular application, we also study PowerShell ExecutionPolicy and their situations and PowerShell command for this change.

Let me know if you’re still having any errors, I’ll help you. You can leave your comments or you can contact me directly by visiting the contact page.

.

Source

Popular Articles