本連載ではここ数回にわたり、Thunderbirdのメールコンポーザを起動するPowerShellスクリプトを作成中だ。本文をシステムクリップボードから持ってくると共に、前回は宛先(To)、送信元(From)、件名(Subject)をパラメータから指定できるようにした。
ファイルやディレクトリの一覧から、必要な行だけを抜き出して表示する例を考えよう。 まず、次のようなディレクトリがあったとする。 PowerShell CoreではSelect-Stringコマンドレットがgrepコマンドと似たような動きをする。 そこでSelect-Stringコマンドレットを ...
Sometimes using ValidateSet isn't enough -- for instance, when you have multiple functions with the same parameter that you need to perform a task on. PowerShell has a data type called an enum, which ...