本連載ではここ数回にわたり、Thunderbirdのメールコンポーザを起動するPowerShellスクリプトを作成中だ。本文をシステムクリップボードから持ってくると共に、前回は宛先(To)、送信元(From)、件名(Subject)をパラメータから指定できるようにした。
PowerShell 7.0.0-preview5ではSelect-Stringコマンドレットにもちょっとした工夫が取り込まれている。Select-Stringコマンドレットは、UNIX系のコマンドで言えばgrepコマンドに相当する機能で、指定したキーワードを含む行だけを抽出する処理を可能にしてくれる。
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 ...