PowerShell Git Bash から pwsh -Command に `$_ を渡すと「unexpected EOF while looking for matching “’」。.ps1 に書いて -File で通った
Git Bash から pwsh -Command 「...」 で try/catch を書き、`$_ とバッククォートを入れると bash が「unexpected EOF while looking for matching ``’」で落ちる。原因は bash のコマンド置換。スクリプトを .ps1 に書いて pwsh -File で実行すれば通る。