问题
VS code 控制台每次初始化都报错
无法加载文件 D:\WindowsPowerShell\profile.ps1,因为在此系统上禁止运
行脚本。有关详细信息,请参阅
https:/go.microsoft.com/fwlink/?LinkID=135170 中的
about_Execution_Policies。
所在位置 行:1 字符: 3
+ . 'D:\WindowsPowerShell\profile.ps1'
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:)
[],PSSecurityExceptio n
+ FullyQualifiedErrorId : UnauthorizedAccess
每次红一片真的很丑诶!
参考 https://www.jianshu.com/p/4eaad2163567 的解决方法。
解决
- 管理员运行 powershell
> get-executionpolicy
> # Restricted
> set-executionpolicy remotesigned
> # 输入Y
- 搞定