Windows用アプリケーション管理 Scoop に乗り換える

最近はMS製品を使う仕事がメインだったので開発環境からは遠ざかっていたが、久しぶりに技術調査・検証を行うために開発環境を整えることに。Macのアプリケーション管理は相変わらず Homebrew が一番人気のようだが、Windowsはどうやら Chocolatey ( https://chocolatey.org/ )から Scoop ( https://scoop.sh/ ) に流れが移っているようなので、Scoopを試すことにした。

# Scoop インストール

https://github.com/lukesampson/scoop こちらを参考に、インストールを行ってみる。

## Requirements
- Windows 7 SP1+ / Windows Server 2008+
- PowerShell 5 (or later, include PowerShell Core) and .NET Framework 4.5 (or later)
- PowerShell must be enabled for your user account e.g. Set ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

``` ps
PS C:\Users\user> pwsh -v
PowerShell 7.0.0
PS C:\Users\user>          
```

私の環境は、Windows 10　PowerShellは7.0.0のようなので問題なし。

インストールはPowerShell上で以下のコマンドを実行するだけ。

``` ps
iwr -useb get.scoop.sh | iex
```

``` ps
PS C:\Users\user> iwr -useb get.scoop.sh | iex
Initializing...
Downloading scoop...
Extracting...
Creating shim...
Downloading main bucket...
Extracting...
Adding ~\scoop\shims to your path.
'lastupdate' has been set to '2020-04-06T16:42:53.1087982+09:00'
Scoop was installed successfully!
Type 'scoop help' for instructions.
PS C:\Users\user>                          
```

``` ps
PS C:\Users\user> 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
hold        Hold an app to disable updates
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
unhold      Unhold an app to enable updates
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.
```

## JDK を検索してみる

``` ps
PS C:\Users\user> scoop search jdk
Results from other known buckets...
(add them using 'scoop bucket add <name>')

'java' bucket:
    bucket/adoptopenjdk-hotspot-jre
    bucket/adoptopenjdk-hotspot
    bucket/adoptopenjdk-lts-hotspot-jre
    bucket/adoptopenjdk-lts-hotspot
    bucket/adoptopenjdk-lts-openj9-jre
    bucket/adoptopenjdk-lts-openj9-xl-jre
    bucket/adoptopenjdk-lts-openj9-xl
    bucket/adoptopenjdk-lts-openj9
    bucket/adoptopenjdk-openj9-jre
    bucket/adoptopenjdk-openj9-xl-jre
    bucket/adoptopenjdk-openj9-xl
    bucket/adoptopenjdk-openj9
    bucket/adoptopenjdk-upstream
    bucket/ojdkbuild-full
    bucket/ojdkbuild
    bucket/ojdkbuild10-full
    bucket/ojdkbuild10
    bucket/ojdkbuild11-full
    bucket/ojdkbuild11
    bucket/ojdkbuild12-full
    bucket/ojdkbuild12
    bucket/ojdkbuild13-full
    bucket/ojdkbuild13
    bucket/ojdkbuild8-full
    bucket/ojdkbuild8
    bucket/ojdkbuild9-full
    bucket/ojdkbuild9
    bucket/openjdk-ea
    bucket/openjdk
    bucket/openjdk10
    bucket/openjdk11
    bucket/openjdk12
    bucket/openjdk13
    bucket/openjdk14
    bucket/openjdk15
    bucket/openjdk7-unofficial
    bucket/openjdk9
    bucket/oraclejdk
    bucket/oraclejdk14

```

なるほど。いろいろなバージョンがヒットしますね。

今日は調査だけ。もう少し触ってみる。