Sha256: f0050d180cf2bc89a3c9f59be64229ccd17377aad89d788c8c52bd01b62f7bc0

Contents?: true

Size: 636 Bytes

Versions: 7

Compression:

Stored size: 636 Bytes

Contents

param (
    [string]$VmId = $(throw "-VmId is required.")
 )

# Include the following modules
$presentDir = Split-Path -parent $PSCommandPath
$modules = @()
$modules += $presentDir + "\utils\write_messages.ps1"
forEach ($module in $modules) { . $module }

try {
  $vm = Hyper-V\Get-VM -Id $VmId -ErrorAction "stop"
  Hyper-V\Start-VM $vm -ErrorAction "stop"
  $state = $vm.state
  $status = $vm.status
  $name = $vm.name
  $resultHash = @{
    state = "$state"
    status = "$status"
    name = "$name"
  }
  $result = ConvertTo-Json $resultHash
  Write-Output-Message $result
}
catch {
  Write-Error-Message "Failed to start a VM $_"
}

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
vagrant-unbundled-2.1.1.0 plugins/providers/hyperv/scripts/start_vm.ps1
vagrant-unbundled-2.0.4.0 plugins/providers/hyperv/scripts/start_vm.ps1
vagrant-unbundled-2.0.3.0 plugins/providers/hyperv/scripts/start_vm.ps1
vagrant-aws-detiber-0.7.2.pre.4 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-419afb4dcffe/plugins/providers/hyperv/scripts/start_vm.ps1
vagrant-aws-detiber-0.7.2.pre.3 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-419afb4dcffe/plugins/providers/hyperv/scripts/start_vm.ps1
vagrant-aws-detiber-0.7.2.pre.2 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-419afb4dcffe/plugins/providers/hyperv/scripts/start_vm.ps1
vagrant-unbundled-2.0.2.0 plugins/providers/hyperv/scripts/start_vm.ps1