原因:因爲安全問題,默認powershell無執行權限。解決辦法:設置權限
1、進入目錄C:\Windows\System32\WindowsPowerShell\v1.0,找到powershell.exe,右鍵“以管理員權限運行”。
2、在打開的powershell,設置:
Set-ExecutionPolicy RemoteSigned
即可。
原因:因爲安全問題,默認powershell無執行權限。解決辦法:設置權限
1、進入目錄C:\Windows\System32\WindowsPowerShell\v1.0,找到powershell.exe,右鍵“以管理員權限運行”。
2、在打開的powershell,設置:
Set-ExecutionPolicy RemoteSigned
即可。
shell腳本獲取腳本所在目錄 執行腳本的父目錄不一定是當前的工作目錄。 url=$(dirname $(readlink -f $0))