site-icon Hong Cheung

如何修正 FullyQualifiedErrorId:UnauthorizedAccess - PowerShell 錯誤

Jan 3, 2024
Programming powershellvscodeprogramming
1分鐘
175字
如何修正 FullyQualifiedErrorId:UnauthorizedAccess - PowerShell 錯誤

問題

我在 Windows 11 上透過 VSCode 的終端機嘗試執行我的 express 指令碼,結果收到以下 PowerShell 錯誤:

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

那個連結對我來說沒有用。

幸運的是,有一個簡單的修正方法。

解決方案

前往「設定」>「系統」>「開發人員專用」。

找到 PowerShell,然後開啟這個選項:

變更執行原則。 -> 開啟

powershell-changeExecutionPolicy

現在再次執行你的指令碼,應該就能正常運作。第一次執行時,系統可能會詢問你是否允許執行。

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!

本文標題:如何修正 FullyQualifiedErrorId:UnauthorizedAccess - PowerShell 錯誤
文章作者:Hong C.
發佈時間:Jan 3, 2024
Copyright 2026
網站地圖
隱私政策
服務條款

主題由 Astro-Yi