AzureのPSコマンドを使用して、特定のVMの現在のステータスを取得しようとしています。私はこれがまっすぐ進むと思ったが、私は間違っていた。PowerShellを使用してAzure VMステータスを取得
私は現在、この使用していCMDを-てみましょう:私は-Statusフラグを使用
Get-AzureRmVM -Name CM01 -ResourceGroupName RG -Status
ResourceGroupName : RG
Name : CM01
Disks[0] :
Name : CM01
Statuses[0] :
Code : ProvisioningState/succeeded
Level : Info
DisplayStatus : Provisioning succeeded
Time : 18/08/2016 08:10:20
VMAgent :
VmAgentVersion : 2.7.1198.778
ExtensionHandlers[0] :
Type : Microsoft.Azure.RecoveryServices.VMSnapshot
TypeHandlerVersion : 1.0.10.0
Status :
Code : ProvisioningState/succeeded
Level : Info
DisplayStatus : Ready
Message : Plugin enabled (name: Microsoft.Azure.RecoveryServices.VMSnapshot, version: 1.0.10.0).
ExtensionHandlers[1] :
Type : Microsoft.Compute.BGInfo
TypeHandlerVersion : 1.2.2
Status :
Code : ProvisioningState/succeeded
Level : Info
DisplayStatus : Ready
Message : Plugin enabled (name: Microsoft.Compute.BGInfo, version: 1.2.2).
Statuses[0] :
Code : ProvisioningState/succeeded
Level : Info
DisplayStatus : Ready
Message : GuestAgent is running and accepting new configurations.
Time : 18/08/2016 14:52:59
Statuses[0] :
Code : ProvisioningState/succeeded
Level : Info
DisplayStatus : Provisioning succeeded
Time : 18/08/2016 12:14:04
Statuses[1] :
Code : PowerState/running
Level : Info
DisplayStatus : VM running
お知らせがそうでなければ、私はVM
の状態に関連する情報を取得しませんStatuses配列を含むオブジェクトを返します。私はStatuses [1] .DisplayStatusの位置にアクセスして 'VM running'メッセージを取得する方法を知らない。 VMステータスは常にStatuses [1]に保存されますか?そこ
Get-AzureRmVM -Name CM -ResourceGroupName RG -Status | Select Statuses[1].DisplayStatus
Statuses[1].DisplayStatus
-------------------------
-Is VMの状態にアクセスするための簡単な方法:
これは私が(それは何も返しません)の値を取得しようとしている方法ですか?
感謝