Windows PowerShell
尝试新的跨平台 PowerShell https://aka.ms/pscore6
. : 无法加载文件 C:\Users\hp\Documents\WindowsPowerShell\profile.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_P
olicies。
C:\Users\hp\Documents\WindowsPowerShell\profile.ps1’
FullyQualifiedErrorId : UnauthorizedAccess
在搜索中打开PowerShell,要以管理员身份打开

然后运行命令Get-ExecutionPolicy可以查看你的PowerShell执行策略
一般来说如果是restrict模式,就可能会出现上面的问题。
你可以通过执行命令Set-ExecutionPolicy RemoteSigned 或 Set-ExecutionPolicy Unrestricted改成RemoteSigned 或Unrestricted模式。
如果RemoteSigned 模式还是出现问题,那就改成Unrestricted模式。
一般改成Unrestricted模式,就会彻底解决不再发生。
