[英]Revert Back PowerShell after “Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force”
Since i need to update npm
manually using npm-windows-upgrade
, 由于我需要使用
npm-windows-upgrade
手动更新npm
,
i put 我放
Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
setting into my PowerShell. 设置到我的PowerShell中。
Now i already finished updating npm
, so i need to return the PowerShell setting to previous state, ie rollback the Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
, how to do that? 现在我已经完成
npm
更新,因此我需要将PowerShell设置返回到以前的状态,即回滚Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
,该怎么做?
您可以通过get-executionpolicy
获取当前的执行策略,因此可以将该状态保存在变量中,以后再用于重置状态。
$ep = get-executionpolicy set-executionpolicy $ep
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.