win10安裝sdkman(posh-gvm)

前言吐槽:有一次專一於搜索結果,走了些彎路。其實踏踏實實按照官網的指引去作,根本沒那麼多事兒。鄙視本身,盡信書不如無書。html

一、打開sdkman官網:http://sdkman.io/index.html
裏面的powershell連接跳到github。git

圖片描述

二、安裝
2a、打開powershell,輸入or粘貼github

(new-object Net.WebClient).DownloadString('https://raw.githubusercontent.com/flofreud/posh-gvm/master/GetPoshGvm.ps1') | iex

若遇到異常:「請求被停止: 未能建立 SSL/TLS 安全通道。」,請在powershell中輸入shell

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

2b、下載後,導入模塊windows

Import-Module posh-gvm

2c、輸入指令驗證安全

gvm help

圖片描述

三、後續補充
3a、powershell的默認執行策略是Restricted,全部腳本都不運行,須要更改:spa

set-executionpolicy unrestricted

3b、Powershell控制檯的許多更改只會在當前會話有效,須要profile來保存一些基本的初始化工做。
我選擇建立私有profile,內容暫時只添加一行:.net

Import-Module posh-gvm

Tip:executionpolicy用管理員權限改成了unrestricted,有安全風險。若是按照默認的restricted,profile的導入沒法執行。rest

圖片描述
關於profile的說明:https://technet.microsoft.com...
網上找到的中文博客:https://www.pstips.net/powers...code

相關文章
相關標籤/搜索