1
0
hugo/content/blog/2017-01-28-windows.md

65 lines
2.5 KiB
Markdown
Raw Normal View History

2024-04-23 13:21:26 +00:00
+++
date = "2017-01-28"
tags = ["windows"]
title = "conemu+nyagos,ps"
slug = "windows"
+++
WindowsのCLI環境をconemu+nyagos,psに移行した。
昔はconsole2+nyaos,msys2,ps(powershell)とかだったけど、それがconemu+nya[g]os,psみたいな感じになった。と言っても、Windows自体対して使ってなかったりもするのだけど、Windowsを触るならCLI環境の構築は必須だと思うので。
conemuはかなりいい感じで、まずpsの起動が速いし、UIも見劣りしない。
nyagosはちょっと触ってみた感じでは良かったと思う。旧nyaosとの違いは今のところあまり感じていないので良さがある(そのうち出てきそうではある)。
conemuはchocoにあるので、それでインストールすればいいが、nyagosはgithubのreleaseからインストールした。インストールと言うか実行ファイルにpsでPATHを通すんだけど、そんな感じで。
個人的にはwindowsはps(またはcmd)で触ったほうがよく、その理由の一つがシステムへの変更が容易である事が挙げられ(エイリアスや関数などが設定されているため)、補完程度に他のシェル(環境?)を使うという感じになると思われる。Windowsメインのユーザーはpsが最もおすすめだと個人的には思ってる。
ただ、Linux, Unixユーザーにとっては「そんなの覚えてられるか!」というものが多く、慣れ親しまないと有用性は低いと思われる(つまり、応用面でwindowsしか通用しない)。
psを使う場合は、こちらのリポジトリ等を参照しながら適当に使っていきます。
https://github.com/powershell
例えば、ssh, module, updateなど。
- https://github.com/PowerShell/Win32-OpenSSH
```bash
> ssh-keygen.exe -t rsa -f id_rsa
> net start ssh-agent
> ssh-add.exe id_rsa
```
- https://github.com/PowerShell/PowerShellGet
```
> Install-PackageProvider Nuget -Force -Scope CurrentUser
```
- https://github.com/PowerShell/xWindowsUpdate
```bash
# 管理者ユーザー
> Start-Process powershell.exe -Verb runas
# スクリプト実行ルールの変更
> Set-ExecutionPolicy RemoteSigned
> $env:PSModulePath
> Save-Module -Name PSWindowsUpdate -Path <path>
> Save-Module -Name xWindowsUpdate -Path <path>
> Install-Module -Name xWindowsUpdate -Scope CurrentUser
> Install-Module -Name PSWindowsUpdate -Scope CurrentUser
> Start-Process powershell -Verb runAs
> Get-WUInstall -AcceptAll -AutoReboot
```
面倒ですね。
以上