Passing arguments to CLI, when run from PowerShell, fails

I noticed when generating a password, the following works as expected:

❯ & bw.exe --response generate --length 20

But when doing this, it fails:

❯ $bwargs = @("--response", "generate", "--length 20")
❯ & bw.exe @bwargs
error: unknown option '--length 20'
❯ & bw.exe $bwargs
error: unknown option '--length 20'
❯ $bwargs = @("--response", "generate --length 20")
❯ & bw.exe $bwargs
Invalid command: generate --length 20
See --help for a list of available commands.

Same thing for generating a passphrase:

❯ & bw.exe --response generate --passphrase --words 5
❯ $bwargs = @("--response", "generate", "--passphrase", "--words 5")
❯ & bw.exe $bwargs
error: unknown option '--words 5'

I am using PowerShell Core 7.3.2 on Windows 10 2H22. I also tested with Windows PowerShell 5.1, and I am getting the same errors.

So far, I have only seen this come up when using the generate option. Others seem to work fine.

Any idea what could be going on?

$bwargs = @(“–response”, “generate”, “–length”, “20”)


PS D:\temp\BW Exports> $bwargs = @(“–response”, “generate”, “–passphrase”, “–words”, “5”)
PS D:\temp\BW Exports> .\bw.exe $bwargs

Thank you. That works.