0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

PowerShellに最低限インストールすべきコマンドとエイリアス

Last updated at Posted at 2025-04-19

インストールするもの

lessコマンドとvimは必須。
vimはともかくlessがないとファイル読めないよね

winget install jftuga.less
winget install vim.vim

設定するエイリアス

PS C:\Users\yugoy> cat $PROFILE
Set-Alias vim 'C:\Program Files\Vim\vim91\vim.exe'
Set-Alias vi  'C:\Program Files\Vim\vim91\vim.exe'
function Show-HistoryFile {
    Get-Content (Get-PSReadLineOption).HistorySavePath
}
Remove-Item Alias:history -Force
Set-Alias history Show-HistoryFile
  • wingetでvimを入れてもパスを通してくれるわけではなかったので、エイリアスで設定
  • powershellのhistoryコマンドが、セッション開始以降しか表示してくれない仕組みだったので全件表示できるようにエイリスを切り直し
  • 本当はgrepも欲しかったけど、lessコマンドの&でgrep的な絞り込みもできるのでよしとする
PS C:\Users\yugoy> history| less

こんな感じで全件ヒストリを眺めながら前回の仕事の続きをする。

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?