Could not change ExecutionPolicy from ByPass

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Will Weatherford Will Weatherford 9 months, 3 weeks ago.

  • Author
    Posts
  • #35268
    Profile photo of Will Weatherford
    Will Weatherford
    Participant

    Somehow, I got my PowershellISE with ISESteroids (Win 7 Pro 64) in a state where Get-ExceptionPolicy = ByPass, and I could do nothing that would change that.

    Well, sort of...

    I then ran:
    Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
    AND I GOT THIS ERROR IN RED.
    Windows PowerShell updated your execution policy successfully, but the setting is overridden by a policy defin
    ed at a more specific scope. Due to the override, your shell will retain its current effective execution poli
    cy of Unrestricted. Type "Get-ExecutionPolicy -List" to view your execution policy settings. For more informat
    ion please see "Get-Help Set-ExecutionPolicy". (raised by: Set-ExecutionPolicy)

    So that tells me my change did not take effect. Which is evidenced when I ran this cmdlet:
    Get-ExecutionPolicy
    Unrestricted

    So it is unrestricted. That certainly is not what I asked for: RemoteSigned.

    BUT the registry says the ExecutionPolicy is RemoteSigned here: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell\ExecutionPolicy.

    So the questions become:
    1) Why doesn't the Get_ExecutionPolicy cmdlet show me the actual ExecutionPolicy and more importantly
    2) How can I work with the the ExecutionPolicy so that it will seem like less of a black box that gives me whatever it feels like giving me, and more of a logical input output tool. Afterall, it has far reaching effects on what I can do.

  • #35328
    Profile photo of Don Jones
    Don Jones
    Keymaster

    Have you run "Get-ExecutionPolicy -List" as the error suggests?

    Are you being impacted by a Group Policy that perhaps sets this? Or is there a profile script that's setting this each time the shell runs?

  • #35467
    Profile photo of Will Weatherford
    Will Weatherford
    Participant

    There are so many tons of documentation I guess I hoped I could pick of this aspect of PS quickly. Nope, gotta dig into. That is fine, because I would rather understand it more thoroughly than less thoroughly.

You must be logged in to reply to this topic.