gpt4 book ai didi

powershell - 虚拟机状态的可能值

转载 作者:行者123 更新时间:2023-12-03 00:34:50 25 4
gpt4 key购买 nike

我们可以使用powershell cmdlet“Get-VM”获取VM的列表。返回的集合具有两列“状态”和“状态”。我需要知道VM的可能状态或状态是什么。我有一个应用程序,需要根据VM的状态(特别是错误状态)执行各种操作。

最佳答案

您可以使用powershell命令:

Import-Module Hyper-V

[enum]::GetNames([Microsoft.HyperV.Powershell.VMState])
[enum]::GetNames([Microsoft.HyperV.Powershell.VMOperationalStatus])

enter image description here

关于powershell - 虚拟机状态的可能值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44623440/

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