Window下安装Scoop命令行工具

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/QQB67G8COM/article/details/83445453

准备:
1)确认Windows Powershell已经安装,按住“SHIFT”键+鼠标右键,在当前文件路径(譬如在桌面)快捷打开Windows Powershell窗口
2)确保浏览器能够访问“https://get.scoop.sh”,访问不了就自行爬墙试试
3)确保安装了Powershell 3(或更高版本)和. net Framework 4.5(或更高版本),升级:安装Windows Management Framework 4.0 及以上的版本即可
4)Note:如果出现错误,你可能需要使用“Set-ExecutionPolicy RemoteSigned -scope CurrentUser”更改执行策略(即启用Powershell)

注意:


在这里插入图片描述

PS C:\Users\Administrator\Desktop> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.16299.666
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.16299.666
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

PS C:\Users\Administrator\Desktop> Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

执行策略更改
执行策略可帮助你防止执行不信任的脚本。更改执行策略可能会产生安全风险,如 https:/go.microsoft.com/fwlink/?LinkID=135170
中的 about_Execution_Policies 帮助主题所述。是否要更改执行策略?
[Y] 是(Y)  [A] 全是(A)  [N] 否(N)  [L] 全否(L)  [S] 暂停(S)  [?] 帮助 (默认值为“N”): A
PS C:\Users\Administrator\Desktop> iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
Initializing...
Downloading...
Extracting...
Creating shim...
Adding ~\scoop\shims to your path.
Scoop was installed successfully!
Type 'scoop help' for instructions.
PS C:\Users\Administrator\Desktop>

重启PowerShell后验证:
在这里插入图片描述
往后通过scoop来安装工具,工具都会自动添加到环境变量中,非常方便。

往后安装的工具会保存到相应user的scoop目录下:C:\Users<username>\scoop\apps

示例:

scoop install curl

异常:无法访问https://get.scoop.sh时会产生异常

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/QQB67G8COM/article/details/83445453