vagrant/plugins/providers/hyperv/scripts/stop_vm.ps1

9 lines
211 B
PowerShell

Param(
[Parameter(Mandatory=$true)]
[string]$VmId
)
# Shuts down virtual machine regardless of any unsaved application data
$VM = Hyper-V\Get-VM -Id $VmId -ErrorAction "Stop"
Hyper-V\Stop-VM $VM -Force