问题解决02:双击执行.ps1文件

双击执行.ps1文件

方法①修改对应注册表值

  1. win+r 打开运行 regedit注册表
  2. 导航到 计算机\HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell
  3. 修改(默认)值为0。如果是Edit,那就是使用powershell_ise.exe打开;如果是Open,那就是使用记事本打开;如果是0,那就是双击可直接执行。

方法②修改打开方式Open对应注册表值

  1. 确保上面的(默认)值为Open(此时双击为Open)。
  2. 导航到 计算机\HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Open\Command
  3. 修改(默认)值为"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -noLogo -ExecutionPolicy unrestricted -file "%1"
posted @ 2023-03-20 20:50  曼醉心  阅读(963)  评论(0编辑  收藏  举报