Merge pull request #10978 from mrshanahan/fix-issue-10973

Fixes issue hashicorp#10973: checks that VMMS WMI reference is null & throws appropriately
This commit is contained in:
Brian Cain 2019-10-01 11:12:41 -07:00 committed by GitHub
commit 8f856949f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -355,6 +355,9 @@ function Report-ErrorVagrantVMImport {
)
$ManagementService = Get-WmiObject -Namespace 'root\virtualization\v2' -Class 'Msvm_VirtualSystemManagementService'
if($null -eq $ManagementService) {
throw 'The Hyper-V Virtual Machine Management Service (VMMS) is not running.'
}
# Relative path names will fail when attempting to import a system
# definition so always ensure we are using the full path to the