Powershell命令行参数带有空格和大括号?

ary*_*ard 5 powershell

我正在尝试我的第一个 powershell 脚本,但在运行以下代码时出现错误参数错误。如何将参数传递给 powersehll 中的命令?

& "bcdedit" /store c:\boot\bcd /set {bootmgr} device partition=C:
Run Code Online (Sandbox Code Playgroud)

编辑: 此操作的工作代码是:

& "bcdedit" /store c:\boot\bcd /set "{bootmgr}" device partition=C:
Run Code Online (Sandbox Code Playgroud)

ary*_*ard 5

大括号把一切都搞砸了。添加引号{bootmgr}解决了问题。

& "bcdedit" /store c:\boot\bcd /set "{bootmgr}" device partition=C:
Run Code Online (Sandbox Code Playgroud)