Fix Win 10 Enterprise Vagrant Error

This fixes error for Win 10 Enterprise:

An error occurred while executing a PowerShell script. This error
is shown below. Please read the error message and see if this is
a configuration error with your system. If it is not, then please
report a bug.

Script: get_vm_status.ps1
Error:

C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.7.4\plugins\providers\hyperv\scripts\get_vm_status.ps1 : Unable to
find type [Microsoft.HyperV.PowerShell.VirtualizationOperationFailedException].
At line:1 char:1
+ &('C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.7.4\plugins\prov ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Microsoft.Hyper...FailedException:TypeName) [get_vm_status.ps1], Ru
   ntimeException
    + FullyQualifiedErrorId : TypeNotFound,get_vm_status.ps1
This commit is contained in:
Mike Averto 2015-08-09 12:44:49 -04:00
parent 186f3f25e3
commit 587c88e65a
1 changed files with 1 additions and 1 deletions

View File

@ -12,7 +12,7 @@ try {
$VM = Get-VM -Id $VmId -ErrorAction "Stop"
$State = $VM.state
$Status = $VM.status
} catch [Microsoft.HyperV.PowerShell.VirtualizationOperationFailedException] {
} catch [Microsoft.HyperV.PowerShell.VirtualizationException] {
$State = "not_created"
$Status = $State
}