Why are my PowerShell scripts not running?

前端 未结 9 1107
感情败类
感情败类 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 09:00

    Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
    

    The above command worked for me even when the following error happens:

    Access to the registry key 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell' is denied.
    

提交回复
热议问题