我在 Windows 10 上的 PowerShell 中有几个我喜欢的别名。
我希望它们在会话之间持续存在,因此我将它们放在 C:\Users{username}\Documents\WindowsPowerShell 下的 profile.ps1 文件中。
我得到这个烦人的“无法加载,因为在这个系统上禁用了正在运行的脚本”。错误消息,并找到了有关如何摆脱它的页面: https ://social.technet.microsoft.com/Forums/en-US/3e4a9006-d47d-4e19-96f4-10327ae0c5b1/not-able-to-在 Windows-10 中运行脚本?forum=winserverpowershell
在这里有人说这条线会有所帮助:
Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force -Verbose
但是,将执行策略设置为对我的用户无限制是否危险?