問題描述:
通過vscode使用powershell的時候報錯:
PS E:\Desktop\code\vscode\Vue> vue init webpack demo
vue : 無法加載檔案 C:\Users\Administrator\AppData\Roaming\npm\vue.ps1,
因為在此系統上禁止運行腳本,有關詳細資訊,請參閱 https:/go.microsoft.co
m/fwlink/?LinkID=135170 中的 about_Execution_Policies,
解決:
按照提示點擊進入官網:
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core
這樣介紹:
PowerShell’s execution policy is a safety feature that controls the conditions under which PowerShell loads configuration files and runs scripts. This feature helps prevent the execution of malicious scripts.
PowerShell的執行策略是一個安全特性,它控制PowerShell加載組態檔和運行腳本的條件,該特性有助于防止惡意腳本的執行,
其有幾種不同的執行策略,可以到網站詳細看,不做介紹,
通過命令查看自己計算機上的策略:

Restricted:限制
Windows客戶端計算機的默認執行策略,允許單個命令,但不允許腳本,禁止運行所有腳本檔案,包括格式化和組態檔(.ps1xml)、模塊腳本檔案(.psm1)和PowerShell組態檔(.ps1),
故將策略更改為RemoteSigned(注意:以管理員身份運行)
Windows客戶端計算機的默認執行策略,腳本可以運行,需要從受信任的發布商那里對從互聯網下載的腳本和組態檔進行數字簽名,其中包括電子郵件和即時訊息程式,不需要在本地計算機上撰寫且未從互聯網上下載的腳本上進行數字簽名,運行從 Internet 下載且未簽名的腳本,如果腳本未受阻止,例如使用 cmdlet,風險從互聯網以外的來源運行未簽名的腳本,以及可能惡意的簽名腳本,

轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/272546.html
標籤:區塊鏈
上一篇:數字貨幣合約跟單是怎樣操作的?
