LoginSignup
1
0

More than 1 year has passed since last update.

PowerShell について知らなかったこと

Last updated at Posted at 2022-12-14

2020 年からアドベントカレンダー期に毎日何かを投稿するという奇祭に参加する習わしがあり今年もゆるゆる参加してみようと思い書くもの。最近、PowerShell をせっかくなら使おうとおもっている。
PowerShellとコマンドプロンプトの違いを簡単に解説します | MacRuby

とりあえず grep
PowerShellでgrep (Select-String) を使う | 晴耕雨読
Get-ChildItem -Recurse | Select-String -Pattern "REGEX"

とか、そういうのは、以下。
Get-Alias (Microsoft.PowerShell.Utility) - PowerShell | Microsoft Learn

Get-Alias をすると教えてくれる

PS C:\workspaces> Get-Alias dir

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Alias           dir -> Get-ChildItem


PS C:\workspaces> get-Alias cd

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Alias           cd -> Set-Location

あと netstat
PowerShell で netstat をするにはどうするの - tech.guitarrapc.cóm
を見ると Get-NetTCPConnection らしいのだが、以下だと怒られるんだな。

PS C:\workspaces> get-alias netstat
get-alias : name 'netstat' を含むエイリアスは存在しないため、このコマンドは一致するエイリアスを見つけられません。
発生場所 :1 文字:1
+ get-alias netstat
+ ~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (netstat:String) [Get-Alias], ItemNotFoundException
    + FullyQualifiedErrorId : ItemNotFoundException,Microsoft.PowerShell.Commands.GetAliasCommand

結論: PowerShell 使い方メモ - Qiita

まあ何事も慣れである。以上私が知らなかったことでした :unlock:

1
0
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
1
0