## 事象
[[init.lua]]で以下のように[[PowerShell]]をシェルとして指定している。
```lua
vim.opt.shell = "pwsh"
```
[[Neovim]]を開いて `!jq .` のようにシェルコマンドを実行しようとしたら、以下のようなエラーが表示される。
```error
shell returned 4000
```
## 原因
#todo
## 解決方法
以下の設定を[[init.lua]]に追加する。
```lua
vim.opt.shellcmdflag = '-nologo -noprofile -ExecutionPolicy RemoteSigned -command'
vim.opt.shellxquote = ''
```
## 参考
- [Running any command with \`:\!\` while setting \`shell\` variable to \`pwsh\` gives an error\. · Issue \#13893 · neovim/neovim](https://github.com/neovim/neovim/issues/13893)