execution policie

This topic contains 2 replies, has 2 voices, and was last updated by  rosse 2 weeks, 2 days ago.

  • Author
    Posts
  • #101638

    rosse
    Participant

    Vous

    hi
    i use a powershell script with a scheduled task
    the script is in this folder

    C:\Program Files\xxx\etc\apps\xxx\bin\pingstatus.ps1
    i have to modify automatically the execution policy (Set-Executionpolicy -Scope CurrentUser -ExecutionPolicy UnRestricted) in the script
    i dont success to code this
    could you help me please???
    regards

  • #101652

    Olaf Soyk
    Participant

    Please take a close look to the help for the Powershell.exe.

    Powershell.exe /?

    Especially to the parameter -ExecutionPolicy!!
    You cannote change the policy to be able to run scripts from inside a script. That's somewhat like the chicken and egg dilemma.

  • #101704

    rosse
    Participant

    OK THANKS

You must be logged in to reply to this topic.