Using the Set-ExecutionPolicy Unrestricted by Powershell

Welcome Forums General PowerShell Q&A Using the Set-ExecutionPolicy Unrestricted by Powershell

This topic contains 1 reply, has 2 voices, and was last updated by

3 years, 11 months ago.

  • Author
  • #26233

    Topics: 1
    Replies: 0
    Points: 0
    Rank: Member


    I just wanna know if it is possible to enable Powershell Scripts, by an Powershell Script?

    If i type in Powershell this "Set-ExecutionPolicy Unrestricted" a new Confirmation pops up and i can Valide this with "Y" but is it possible that to make a Powershell Script so that it Validate automatically?

    Thank You Very Much 🙂

  • #26236

    Topics: 9
    Replies: 2322
    Points: 0
    Rank: Member

    Set-ExecutionPolicy has a -Force switch to suppress the prompt. To avoid any problems with powershell preventing you from running a script file in the first place, you can use powershell.exe with its -Command parameter:

    powershell.exe -Command Set-ExecutionPolicy Unrestricted -Force

The topic ‘Using the Set-ExecutionPolicy Unrestricted by Powershell’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort