PowerShellのベル音(Beep)を消す方法 †Windows10で文字がない状態で、BS(Backspace)キーを押すと、「ピー!」と音が鳴る方は、 関連サイト †
関連記事 †PowerShellのバージョン †PS C:\> $PSVersionTable Name Value ---- ----- PSVersion 5.1.17134.407 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.17134.407 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 PSReadlineOptionのBellStyle †PSReadlineのBellStyleがVisibleの場合、何も文字がないところでBSキーを押すと、 Set-PSReadlineOption のBellStyleは以下のようになっています。 -BellStyle Specifies how PSReadLine responds to various error conditions or user prompts. If you do not specify this parameter, the default response is Audible. The acceptable values for this parameter are: - None. No feedback. - Visual. Text flashes briefly. - Audible. A short beep. 初期値では以下のように Audible となっていました。 PS C:\> (Get-PSReadlineOption).BellStyle Audible BellStyleをNoneする †上記の抜粋の通り、BellStyleにNoneを指定すれば、ベル音は出なくなります。 Set-PSReadlineOption -BellStyle None 本設定をPowerShellコンソールを起動したときに、自動実行したい場合は、$PROFILE変数が示すファイルに 以上、PowerShellのベル音を止める方法でした。 |