Why is my locally-created script not allowed to run under the RemoteSigned execution policy?

后端 未结 13 1003
自闭症患者
自闭症患者 2021-01-30 02:35

Since this question continues to attract responses that are either refuted by the question body or don\'t address the actual problem, please read th

相关标签:
13条回答
  • 2021-01-30 03:15

    Try running the Powershell GUI as Administrator

    0 讨论(0)
  • 2021-01-30 03:18

    Please make a backup for the script.bs1 file

    What works for me was deleting the script.bs1 file and running the execution command.

    0 讨论(0)
  • 2021-01-30 03:20

    I was having the same issue and fixed it by changing the default program to open .ps1 files to PowerShell. It was set to Notepad.

    0 讨论(0)
  • 2021-01-30 03:25

    If the file is copied from a network location, that is, another computer, Windows might have blocked that file. Right click on the file and click on the unblock button and see if it works.

    0 讨论(0)
  • 2021-01-30 03:26

    Run below 2 commands in PowerShell window

    1. Set-ExecutionPolicy unrestricted

    2. Unblock-File -Path D:\PowerShell\Script.ps1

    0 讨论(0)
  • 2021-01-30 03:29

    I have found out when running a PS1 file for a Mapped drive to Dropbox that I'm always getting this error. When opening up properties for the PS1 there is no "Unblock".

    The only thing that work for me is

    powershell.exe -executionpolicy bypass -file .\Script.ps1

    0 讨论(0)
提交回复
热议问题