Skip to content

環境構築

Win11をScoopでセットアップ

はじめに

新しいWindowsマシンが来たとき、アプリケーションを一つずつインストールするのは結構大変です。楽をするため、そして管理しやすくするため、現状ではScoopを利用しているのでその備忘録です。

Powershellをインストール

元から入っているWindows Powershellというやつではなく、OSS版のPowershell(無印)をMIcrosoft Storeからインストールして使います。

https://apps.microsoft.com/detail/9MZ1SNWT0N5D?hl=neutral&gl=JP&ocid=pdpshare

ひたすらコマンド入力

実行ポリシーを変更

DefaultではRestrictedになっているようで、そのままでは素のps1ファイルを実行できず次の手順において少し不便です。従って一時的にUnrestrictedにしておきます。Remotesignedではダメで、証明書が云々など面倒くさそうだったので深追いはしていません。

shell
Set-ExecutionPolicy Unrestricted -Scope CurrentUser

ps1ファイルを実行

適当なフォルダにsetupWin11.ps1を置いて実行します。

shell
.\setupWin11.ps1
shell
# scoopのインストール
irm get.scoop.sh | iex

# gitのインストール
# Extrasを引っ張ってくるために必要なので順番が先
scoop install git

# Scoop Extrasを予め引っ張ってくる
scoop bucket add extras

# iyokan-jpも引っ張ってくる
scoop bucket add iyokan-jp https://github.com/tetradice/scoop-iyokan-jp

# 各種ツールをインストール
scoop install aria2
scoop install curl
scoop install wget
scoop install gsudo

scoop install docker
scoop install python
scoop install doxygen
scoop install graphviz
scoop install ffmpeg

scoop install posh-git
scoop install oh-my-posh
scoop install Terminal-Icons

scoop install googlechrome
scoop install zoom

scoop install rufus
scoop install crystaldiskinfo
scoop install crystaldiskmark
scoop install gpu-z

scoop install obsidian
scoop install vim
scoop install edit
scoop install mery
scoop install vscode

スタートアップの設定

ターミナル起動時に毎回モジュールを自動で呼び出すため、$PROFILEで指定されているファイルに以下を書き込んで保存します。(C:\Users\[username]\Documents\PowerShell\Microsoft.PowerShell_profile.ps1が開くはずですが、存在しなければ自分で作成する必要があるかもしれません。)

shell
Import-Module PSReadLine
Import-Module Terminal-Icons
Import-Module posh-git
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH/capr4n.omp.json" | Invoke-Expression;

実行ポリシーを変更その2

元のdefaultに戻すと今しがた設定したprofile.ps1を実行できないので、Remotesignedにしておきます。

shell
Set-ExecutionPolicy Remotesigned -Scope CurrentUser

その他

当該のWindowsマシンをカジュアルに利用して良い場合は、追加で以下も実行するかもしれません。

shell
scoop install discord
scoop install figma
scoop install kicad


Some rights reserved.