Windows用のパッケージマネージャChocolateyをインストールしてみる

Atomapmコマンドを使いたかったのですが、どうやらWindowsではzip形式でインストールしたものだとapmコマンドが使えないようで、ChocolateyというWindows用のパッケージマネージャでインストールする必要があるようです。

というわけでChocolateyをインストールしてみました。
https://chocolatey.org/

まずはPowerShellを管理者権限で立ち上げ以下のコマンドを入力します(入力するコマンドはChcolateyのサイトに書かれているのでそちらを確認してください)。

PS > iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))

すると「スクリプトの実行がシステムで無効になっているため…」のように怒られてしまいました。以下のようにして実行ポリシーを変更しておく必要があるようです。

PS > Set-ExecutionPolicy RemoteSigned

もう一度同じコマンドを実行すればChcolateyがインストールされるはずです。

続いてAtomをインストールしてみます。Chcolateyのインストール時だけでなく、chocoコマンドを使う場合はPowerShellを管理者権限で実行しておく必要があるみたい。

PS > choco install Atom

apmコマンドが使えるかな?

PS > apm

apm - Atom Package Manager powered by https://atom.io

Usage: apm <command>

where <command> is one of:
    clean, dedupe, deinstall, delete, dev, develop, docs, erase, featured,
    home, init, install, link, linked, links, list, ln, lns, login, ls, open,
    outdated, publish, rebuild, rebuild-module-cache, remove, rm, search, show,
    star, starred, stars, test, uninstall, unlink, unpublish, unstar, update,
    upgrade, view.

Run `apm help <command>` to see the more details about a specific command.

Options:
  --version, -v  Print the apm version
  --help, -h     Print this usage message
  --color        Enable colored output     [boolean]  [default: true]

おお、これでようやくapmコマンドが使えるようになりました。

Chocolateyは初めて使ったのですが、豊富なパッケージが用意されており、アップデートもChocolateyででき、ChocolateyGUIというのをインストールしておくとGUIでChocolateyを使うこともできるみたいです。今後Windowsのパッケージ管理システムとして開発環境構築等の用途に定着していくのでしょうか?