通过注册表修改默认关联

  • 打开注册表编辑器
    win + r 输入 regedit

  • 导航到

1
HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Open\Command
  • 修改值为
1
"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -ExecutionPolicy Bypass -File "%1"