我跑步时
> Stop-VM -Name "VMNAME" -confirm:$false
我收到确认的提示:
Confirm
Hyper-V cannot shut down virtual machine VMNAME because the Shutdown integration service is
unavailable. To avoid potential data loss, you can pause or save the state of the virtual machine.
The
other option is to turn off the virtual machine, but data loss might occur.
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): N
但是,当我运行脚本(例如cron)时,我不想进行任何交互并暂停该团队。 我希望该命令返回错误或不返回任何内容(以后再处理命令的结果),但不停止执行等待控制台中输入的操作。 我想对这样的请求回答“否”(据我所知,强制给出的答案始终是“是”。)