gpt4 book ai didi

c# - 电源外壳 : Execution Policy

转载 作者:太空狗 更新时间:2023-10-29 23:47:11 25 4
gpt4 key购买 nike

过去几个月我一直在通过这样做来运行我的代码 -

Set-ExecutionPolicy Unrestricted

但是,发生了一些奇怪的事情,我总是收到这个错误 -

Windows PowerShell updated your execution policy successfully, but the setting is overridden by a policy defined at a more specific scope. Due to the override, your shell will retain its current effective execution policy of "Unrestricted". Type "Get-ExecutionPolicy -List" to view your execution policy settings. For more information, please see "Get-Help Set-ExecutionPolicy."

我已经引用了这些链接,但没有成功 -

Get-ExecutionPolicy -List

MachinePolicy                                                           
UserPolicy
Process
CurrentUser
LocalMachine

最佳答案

您应该从 Get-ExecutionPolicy -List 中看到这样的输出:

        Scope ExecutionPolicy
----- ---------------
MachinePolicy Undefined
UserPolicy Undefined
Process Undefined
CurrentUser Undefined
LocalMachine RemoteSigned

一旦您看到具有不需要的设置的范围,您可以像这样重置它:

Set-ExecutionPolicy Undefined -Scope <scope-name>

这是假设您有权这样做。

关于c# - 电源外壳 : Execution Policy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12466456/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com