## 事象 [[PowerShell]]の7.3.0から[[brコマンド]]が以下のエラーになる。 ``` error: The argument '<FILE>' requires a value but none was supplied ``` [[PowerShell]]7.2.7では問題なかった。 [[Microsoft.PowerShell_profile.ps1]]は以下の通り。 ```powershell function bo() { broot --conf $env:USERPROFILE\broot.toml $args } function br() { $outcmd = new-temporaryfile bo --outcmd $outcmd $args if (!$?) { remove-item -force $outcmd return $lastexitcode } $command = get-content $outcmd if ($command) { # workaround - paths have some garbage at the start $command = $command.replace("\\?\", "", 1) invoke-expression $command } remove-item -force $outcmd } ``` ## 原因 分からない...が、以下の`<FILE>`が渡されていなそう。 ```console USAGE: broot.exe [OPTIONS] [FILE] ARGS: <FILE> Root Directory ``` つまり、以下の`bo`コマンドに`$args`が渡っていない? ```powershell function bo() { broot --conf $env:USERPROFILE\broot.toml $args } function br() { $outcmd = new-temporaryfile # $argsが空のままbo(broot)が実行されてしまっている??? bo --outcmd $outcmd $args # 以下略 } ``` けどそもそも`<FILE>`は任意に見える...謎。 ## 解決方法 `bo()`でwrapせず、`br`を直接呼び出したら動いた。 ```diff - function bo() { broot --conf $env:USERPROFILE\broot.toml $args } function br() { $outcmd = new-temporaryfile - bo --outcmd $outcmd $args + broot -g --conf $env:USERPROFILE\broot.toml --outcmd $outcmd $args # 以下略 } ```