问题随记 ——【Windows】无法加载文件 C:UsersAdministratorDocumentsWindowsPowerShellprofile.ps1-繁依Fanyi

文章目录

问题描述

打开 PowerShell 出现以下报错:

. : 无法加载文件 C:UsersAdministratorDocumentsWindowsPowerShellprofile.ps1。未对文件 C:UsersAdministratorDocume
ntsWindowsPowerShellprofile.ps1 进行数字签名。无法在当前系统上运行该脚本。有关运行脚本和设置执行策略的详细信息,请参
阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。
所在位置 行:1 字符: 3
+ . 'C:UsersAdministratorDocumentsWindowsPowerShellprofile.ps1'
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [],PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

在这里插入图片描述

解决方法

① 管理员权限运行 PowerShell,并输入以下命令

set-executionpolicy remotesigned

② 再输入Y进行确认

在这里插入图片描述

注意:一定要以管理员权限运行,否则会出现以下报错。

在这里插入图片描述

© 版权声明
THE END
喜欢就支持一下吧
点赞11 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容