无法加载文件 C:\Users\xxx\Documents\WindowsPowerShell\profile.ps1,因为在此系统上禁止运行脚本。
问题:打开 PowerShell,提示如下类似报错信息:
1 | Windows PowerShell |
原因:Windows 下 PowerShell 的脚本执行策略的默认设置为 Restricted:
1 | PS C:\Windows\system32> get-ExecutionPolicy |
解决:以管理员身份运行 PowerShell,修改脚本执行策略:
1 | PS C:\Windows\system32> set-ExecutionPolicy RemoteSigned |










