Why are my PowerShell scripts not running?

前端 未结 9 1106
感情败类
感情败类 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:46

    We can bypass execution policy in a nice way (inside command prompt):

    type file.ps1 | powershell -command -
    

    Or inside powershell:

    gc file.ps1|powershell -c -
    

提交回复
热议问题