前言吐槽:有一次专一于搜索结果,走了些弯路。其实踏踏实实按照官网的指引去作,根本没那么多事儿。鄙视本身,尽信书不如无书。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