File C:\Users\AppData\Roaming\npm\func.ps1 cannot be loaded. The file C:\Users\AppData\Roaming\npm\func.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.

If you’re recieving the above error when trying to dubug an Azure Function (or similar) in Visual Studio Code then the current users execution policy needs to be updated to allow unsigned PowerShell scripts to be run. This can be done by running the below code in a terminal window.

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

1 Comment

faraji · 15 June 2022 at 7:32 am

You really saved my bacon with this thank you!

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *