Why are my PowerShell scripts not running?

前端 未结 9 1102
感情败类
感情败类 2020-12-07 08:33

I wrote a simple batch file as a PowerShell script, and I am getting errors when they run.

It\'s in a scripts directory in my path. This is the error I get:

9条回答
  •  死守一世寂寞
    2020-12-07 08:45

    It could be PowerShell's default security level, which (IIRC) will only run signed scripts.

    Try typing this:

    set-executionpolicy remotesigned
    

    That will tell PowerShell to allow local (that is, on a local drive) unsigned scripts to run.

    Then try executing your script again.

提交回复
热议问题