如果運行hexo s 報以下錯誤
無法加載文件 C:\Users\Administrator\AppData\Roaming\npm\hexo.ps1,因為在此系統中禁止執行腳本。有
關詳細信息,請參閱 "get-help about_signing"。
所在位置 行:1 字符: 5
+ hexo <<<< s
+ CategoryInfo : NotSpecified: (:) [], PSSecurityException
+ FullyQualifiedErrorId : RuntimeException
解決如下:
Win7系統以管理員身份運行PowerShell
執行:get-ExecutionPolicy,返回狀態:Restricted,表示狀態是禁止的,
然后要設置下
執行:set-ExecutionPolicy RemoteSigned 開啟
選擇Y
注意:一定要以管理員的身份運行PowerShell,不是cmd窗口!