2019-01-28  22:49:21

资料来源自Scoop官方网站以及github上的帮助文档

Scoop -- A command-line installer for Windows

是开发人员用来安装程序用的,使用命令行进行操作。

安装前提(所需要的环境):

操作环境:win10。

确保你的 PowerShell 版本 >= 3. win7或许低于3,得升级。

PowerShell在哪里?以下三种方法可找到:

  1. win + R 打开运行后输入powershell然后确定;(和环境变量有关)

  2. cmd中输入powershell然后回车;(和环境变量有关)

  3. 在开始菜单中查找;

如何查看自己的PowerShell 版本呢?在PowerShell中输入如下内容:

$psversiontable.psversion.major

本人电脑上显示如下:

 PS C:\Users\user> $psversiontable.psversion.major
5

然后确保你允许PowerShell执行本地脚本,在PowerShell中输入如下内容,已完成执行策略的更改:

set-executionpolicy remotesigned -scope currentuser

遇到提示,输入Y即可。

开始安装Scoop.

在PowerShell中输入如下内容(将会安装到默认目录C:\Users\user(自己的用户名)\scoop,也可指定安装目录):

iex (new-object net.webclient).downloadstring('https://get.scoop.sh')

想要指定安装目录,在PowerShell中输入如下内容(代码中的D:\Applications\Scoop为指定的目录):

[environment]::setEnvironmentVariable('SCOOP','D:\Applications\Scoop','User')
$env:SCOOP='D:\Applications\Scoop'
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')

等待安装完成。。。

使用Scoop(在cmd和PowerShell中输入以下命令均可,因为已经为Scoop自动设置了环境变量)。

输入以下命令查看Scoop命令的概述:

scoop help

结果显示如下:

 PS C:\Users\15991> scoop help
Usage: scoop <command> [<args>] Some useful commands are: alias Manage scoop aliases
bucket Manage Scoop buckets
cache Show or clear the download cache
checkup Check for potential problems
cleanup Cleanup apps by removing old versions
config Get or set configuration values
create Create a custom app manifest
depends List dependencies for an app
export Exports (an importable) list of installed apps
help Show help for a command
home Opens the app homepage
info Display information about an app
install Install apps
list List installed apps
prefix Returns the path to the specified app
reset Reset an app to resolve conflicts
search Search available apps
status Show status and check for new app versions
uninstall Uninstall an app
update Update apps, or Scoop itself
virustotal Look for app's hash on virustotal.com
which Locate a shim/executable (similar to 'which' on Linux) Type 'scoop help <command>' to get help for a specific command.

输入'scoop help <command>'可以查看具体的某个命令的用法,如下所示:

scoop help install

显示结果如下:

 PS C:\Users\15991> scoop help install
Usage: scoop install <app> [options] e.g. The usual way to install an app (uses your local 'buckets'):
scoop install git To install an app from a manifest at a URL:
scoop install https://raw.github.com/lukesampson/scoop/master/bucket/runat.json To install an app from a manifest on your computer
scoop install \path\to\app.json When installing from your computer, you can leave the .json extension off if you like. Options:
-g, --global Install the app globally
-i, --independent Don't install dependencies automatically
-k, --no-cache Don't use the download cache
-s, --skip Skip hash validation (use with caution!)
-a, --arch <32bit|64bit> Use the specified architecture, if the app supports it

查找要安装的程序,如gradle:

scoop search gradle

显示结果如下:

 PS C:\Users\15991> scoop search gradle
'main' bucket:
gradle-bin (5.1.1)
gradle (5.1.1)

查找所有可用程序:

scoop search

安装程序,如gradle,默认会安装到Scoop安装目录下的apps目录:

scoop install gradle

显示结果如下:

 PS C:\Users\15991> scoop install gradle
Installing 'gradle' (5.1.1) [32bit]
gradle-5.1.1-all.zip (124.7 MB) [> ] 1%

也可将程序安装到指定目录,如F:\GlobalScoopApps:

[environment]::setEnvironmentVariable('SCOOP_GLOBAL','F:\GlobalScoopApps','Machine')
$env:SCOOP_GLOBAL='F:\GlobalScoopApps'
scoop install -g <app>

对Scoop进行版本更新:

scoop update

对Scoop安装的所有程序进行更新(也可指定某个程序进行更新):

scoop update *

Scoop - 在Windows命令行上进行程序安装的更多相关文章

  1. 您可以从 Windows 命令行上运行 gcc、g++、ar、ranlib、dlltool 和其他一些 GNU 工具

    Windows 上的安装为了在 Windows 上安装 GCC,您需要安装 MinGW.为了安装 MinGW,请访问 MinGW 的主页 www.mingw.org,进入 MinGW 下载页面,下载最 ...

  2. Linux命令行上程序执行的那一刹那!

    转自:http://www.cppblog.com/cuijixin/archive/2008/03/14/44463.html by falcon<zhangjinw@gmail.com> ...

  3. python如何通过windows命令行运行一个python程序文件?

    python如何通过windows命令行运行一个python程序文件? cmd 进入到py文件对应目录下或者直接在上面的文件地址栏输入cmd,敲入回车 定位到对应的目录下 输入python xxx.p ...

  4. windos命令行下的程序编写

    1.命令行下写程序. 写程序一定要用IDE?不,我还可以用记事本呢.呵呵,写程序一定要用记事本?? ———————————————— 命令行下输入copy con test.txt后回车可在相应目录下 ...

  5. 探索Windows命令行系列(2):命令行工具入门

    1.理论基础 1.1.命令行的前世今生 1.2.命令执行规则 1.3.使用命令历史 2.使用入门 2.1.启动和关闭命令行 2.2.执行简单的命令 2.3.命令行执行程序使用技巧 3.总结 1.理论基 ...

  6. 探索Windows命令行系列(5):几个实用的命令例解

    1.关机命令(shutdown) 2.管理 Windows 服务(sc) 3.管理任务进程(tasklist.taskkill) 4.显示 TCP/IP 配置值(ipconfig) 5.网络诊断工具( ...

  7. 探索Windows命令行系列(6):活用批处理解决实际问题

    1.批量修改文件名 2.批量重启服务 3.全盘搜索指定文件 3.1.全盘搜索名称为 mm.jpg 的文件,获取其全路径 3.2.查找系统中所有名称以 .docx 结尾的文件 4.调用可执行程序 4.1 ...

  8. Windows命令行command的Shell命令详细解析和语法

    CMD命令大全及详细解释和语法 Microsoft Windows XP [版本 5.1.2600] 有关某个命令的详细信息,请键入 HELP 命令名 ASSOC    显示或修改文件扩展名关联. A ...

  9. 探索Windows命令行系列(1):导航目录

    探索Windows命令行系列(1):导航目录 探索Windows命令行系列(2):命令行工具入门 探索Windows命令行系列(3):命令行脚本基础 探索Windows命令行系列(4):通过命令操作文 ...

随机推荐

  1. 【前端】jQuery的animate在火狐浏览器上不支持backgroundPosition的解决方法

    转载请注明出处:http://www.cnblogs.com/shamoyuu/p/4375678.html jQuery的animate是一个非常好用的东东,但某些动画效果支持得不够好,比如back ...

  2. JS判断字符串中是否存在某个字符

    用String类中的indexOf函数,例如:String str="we find out sth";if(str.indexOf("o")==-1){ // ...

  3. ASP.Net 下载大文件的实现 (转)

    原文:http://www.cnblogs.com/luisliu/p/4253815.html 当我们的网站需要支持下载大文件时,如果不做控制可能会导致用户在访问下载页面时发生无响应,使得浏览器崩溃 ...

  4. bzoj 1707: [Usaco2007 Nov]tanning分配防晒霜【贪心||最大流(?)】

    洛谷上能过的最大流bzoj上T了--但是贪心做法明明在洛谷上比最大流要慢啊--如果是最大流的话就是裸题了吧 说一下贪心,就按照防晒霜排序,然后对每一个防晒霜选一头可以使用的且r最小的牛 就,没了. 贪 ...

  5. c++编程中处理char和wchar_t的好工具

    /* ttype.h sdragonx 2015-02-18 18:32:43 这个几个模版函数是为了处理ansi或unicode,使字符串值或者字符串函数能够在模版中使用 2018/7/26 23: ...

  6. O(1)的快速乘

    那么 有位神仙已经说了O(1)的算法(当然不是我) 这是一种骚操作 直接放代码了啊 inline LL mul(LL a,LL b,LL Mod){ LL lf = a * ( b >> ...

  7. Java多线程(五)停止线程 在沉睡中停止线程

    在沉睡中停止线程会抛出异常 public class SleepInterruptDemo extends Thread { public void run() { super.run(); try ...

  8. [Qt Quick入门] 基本元素初体验

    Qt Quick作为QML语言的标准库,提供了很多基本元素和控件来帮助我们构建Qt Quick应用.这节我们简要地介绍一些Qt Quick元素,如Rectangle.Item.Text.Button. ...

  9. C#基础 结构体 枚举类型

    结构体:就是一个自定义的集合,里面可以放各种类型的元素,用法大体跟集合一样. 一.定义的例子: struct student { public int nianling; public int fen ...

  10. 使用Micrisoft.net设计方案 第三章Web表示模式 Web模式集群详细介绍 Observer(观察器)

    在面向对象的编程中,对象同时包含数据和行为,这两者一起表示业务域的特定方面.使用对象生成应用程序的优点之一是可以将所有数据操作封装在对象内.这样, 就使对象成为独立的单位,并增加了在其他应用程序中重用 ...