Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Scoop 一個跨平台的軟體管理工具,用於安裝各式各樣的環境,類似於 Ubuntu 的 apt-get。
Scoop 一個跨平台的軟體管理工具,用於安裝各式各樣的環境,類似於 Ubuntu 的 apt-get。
相似的軟體有 :
Scoop 專注於在 Command-line 的使用,可以直接安裝軟體與版本管控不需要一直到網頁下載。
Powershell 中運行
$psversiontable.psversion.major # should be >= 3
set-executionpolicy remotesigned -scope currentuser
確認上方無誤後,在 powershell 中打入安裝指令。
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
如果想要安裝到指定目錄(如 : 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 help | 查看有哪些指令可用 |
scoop install {app name} | 安裝指定 app |
scoop search {app name} | 搜尋資料庫確認是否有此 app 或觀察目前版本 |
scoop update | 新 scoop ,後方可加上 app 名稱,表示更新 app。 如果使用 * 則是安裝的全部都更新 |
scoop cleanup {app name} | 刪掉目前沒用或較舊的 app 版本 |
scoop uninstall {app name} | 刪掉已安裝指定的 app |
scoop uninstall scoop | 刪除 scoop |
Scoop 有一個主要的 Bucket,當你使用 scoop install {app}
會先搜尋主要的 bucket,當然還可以搜尋外部的 Bucket,更甚至你可以自己做自己的 bucket。查詢目前系統中的 Buckets:
scoop bucket known
註冊外部(別人建置的) Buckets 到本地端
// 主要格式為
scoop bucket add {name-of-bucket} {location-of-git-repo}
// 舉例如下 Buckets name {extras} {git-repo}
scoop bucket add extras https://github.com/lukesampson/scoop-extras.git
創建新的 Git-repo,將 app 加入到 Git-repo 中
git clone https://github.com/<your-username>/my-bucket
cd my-bucket
'{ version: "1.0",
url: "https://gist.github.com/lukesampson/6446238/raw/hello.ps1",
bin: "hello.ps1"
}' > hello.json
git add .
git commit -m "add hello app"
git push
設定你的 scoop 去連結你自己新建立的 bucket :
scoop bucket add my-bucket https://github.com/<your-username>/my-bucket
測試
scoop bucket list # -> 應該要看到自己的 bucket
scoop search hello # -> 應該要看到 hello 被放在 "my-bucket bucket:" 下面
scoop install hello
hello
hello # -> 應該要看到 'hello,<windows-username>!'
Example:
{
"version" : "1.0",
"url" : "https://github.com/lukesampon/cowsay-psh/archive/master.zip"
"extract_dir" : " cowsay-psh-master",
"bin" : "cowsay.ps1"
}
當我們使用指令“scoop install “的時候,
如果要改變下載後的檔案名稱,可以加入 URL 片段 (從 “#“後面開始)
這個範例表示,下載 program.exe 檔案,但是儲存成 dl.7z。這個技術常常被用來傳遞有著不好副作用的可執行安裝檔,像是註冊表改變、放置在安裝目錄之外的文件、管理員提升提示。
"http://example.org/program.exe" -> "http://example.org/program.exe#/dl.7z" // 從 #/ 後面開始