gpt4 book ai didi

带空格和花括号的 Powershell 命令行参数?

转载 作者:行者123 更新时间:2023-12-02 23:05:28 25 4
gpt4 key购买 nike

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

& "bcdedit" /store c:\boot\bcd /set {bootmgr} device partition=C:

编辑:其工作代码是:

& "bcdedit" /store c:\boot\bcd /set "{bootmgr}" device partition=C:

最佳答案

大括号把一切都扔掉了。在 {bootmgr} 周围加上引号解决了这个问题。

& "bcdedit" /store c:\boot\bcd /set "{bootmgr}" device partition=C:

关于带空格和花括号的 Powershell 命令行参数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10852132/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com