0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

powershellで $ErrorActionPreference = "Stop" とすると標準エラー出力が使えなくなる

Posted at

使えなくなる

$ErrorActionPreference = "Stop"
& stdErrCommand 2>$null

ダメです。例外が飛びます。えーっとどうやって回避するんだこれ?
stdErrCommandが普通の コマンドレットなら-ErrorAction Continueとかすればいいんだけどうけど、exeファイルへのエイリアスだった時とかどうすればいいんだ?Start-processダメっぽいけど・・・・

  • exeファイルへのエイリアス(パスを通している訳ではない)
  • ps1ファイルへのエイリアス(パスを通している訳ではない)

そもそもこのコマンドの時はアンパサンドで実行するのか、表記的には普通のコマンドレッドで書くのかよくわからん

謎が多いな~ というか例外くらい普通に投げて欲しかったかも・・・

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?