設置雙擊ps1腳本直接用Powershell打開。
默認.ps1 文件雙擊是不能打開的,只能右鍵運行。
解決方法:
1.按windows+R打開運行,輸入regedit,打開註冊表
2.找到HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Open\Command
3.雙擊右邊的默認,將數值數據改爲如下,點擊確認保存。
"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" "-NoExit" -file "%1"
OK