Sha256: 946e4fc7d26af5f81d2cc95d379666d854b4bb2f1fb8fdef1b1961f904724006
Contents?: true
Size: 605 Bytes
Versions: 5
Compression:
Stored size: 605 Bytes
Contents
Param( [Parameter(Mandatory=$true)] [string]$VmId ) # Include the following modules $Dir = Split-Path $script:MyInvocation.MyCommand.Path . ([System.IO.Path]::Combine($Dir, "utils\write_messages.ps1")) # Get the VM with the given name try { $VM = Get-VM -Id $VmId -ErrorAction "Stop" $State = $VM.state $Status = $VM.status } catch [Microsoft.HyperV.PowerShell.VirtualizationOperationFailedException] { $State = "not_created" $Status = $State } $resultHash = @{ state = "$State" status = "$Status" } $result = ConvertTo-Json $resultHash Write-Output-Message $result
Version data entries
5 entries across 2 versions & 2 rubygems