fix hyper-v powershell
This commit is contained in:
parent
de8faa0fa4
commit
bb89649b02
|
@ -151,6 +151,7 @@ sub manage_selection {
|
|||
my $checkpoint = { backing => -1, snapshot => -1 };
|
||||
my $checkpoints = (ref($node->{checkpoints}) eq 'ARRAY') ? $node->{checkpoints} : [ $node->{checkpoints} ];
|
||||
foreach my $chkpt (@$checkpoints) {
|
||||
next if (!defined($chkpt));
|
||||
$chkpt->{creation_time} =~ s/,/\./g;
|
||||
$checkpoint->{ $chkpt->{type} } = $chkpt->{creation_time} if ($chkpt->{creation_time} > 0 && ($checkpoint->{ $chkpt->{type} } == -1 || $checkpoint->{ $chkpt->{type} } > $chkpt->{creation_time}));
|
||||
}
|
||||
|
@ -158,20 +159,20 @@ sub manage_selection {
|
|||
|
||||
if (defined($self->{option_results}->{filter_vm}) && $self->{option_results}->{filter_vm} ne '' &&
|
||||
$node->{name} !~ /$self->{option_results}->{filter_vm}/i) {
|
||||
$self->{output}->output_add(long_msg => "skipping '" . $node->{name} . "': no matching filter.", debug => 1);
|
||||
$self->{output}->output_add(long_msg => "skipping '" . $node->{name} . "': no matching filter.", debug => 1);
|
||||
next;
|
||||
}
|
||||
if (defined($self->{option_results}->{filter_note}) && $self->{option_results}->{filter_note} ne '' &&
|
||||
if (defined($self->{option_results}->{filter_note}) && $self->{option_results}->{filter_note} ne '' &&
|
||||
defined($node->{note}) && $node->{note} !~ /$self->{option_results}->{filter_note}/i) {
|
||||
$self->{output}->output_add(long_msg => "skipping '" . $node->{name} . "': no matching filter.", debug => 1);
|
||||
$self->{output}->output_add(long_msg => "skipping '" . $node->{name} . "': no matching filter.", debug => 1);
|
||||
next;
|
||||
}
|
||||
if (defined($self->{option_results}->{filter_status}) && $self->{option_results}->{filter_status} ne '' &&
|
||||
$node_vm_state->{ $node->{state} } !~ /$self->{option_results}->{filter_status}/i) {
|
||||
$self->{output}->output_add(long_msg => "skipping '" . $node->{name} . "': no matching filter.", debug => 1);
|
||||
$self->{output}->output_add(long_msg => "skipping '" . $node->{name} . "': no matching filter.", debug => 1);
|
||||
next;
|
||||
}
|
||||
|
||||
|
||||
$self->{vm}->{$id} = {
|
||||
display => $node->{name},
|
||||
snapshot => $checkpoint->{snapshot} > 0 ? $time - $checkpoint->{snapshot} : undef,
|
||||
|
|
|
@ -53,18 +53,18 @@ Try {
|
|||
$item.name = $vm.VMName
|
||||
$item.state = $vm.State.value__
|
||||
$item.integration_services_state = $vm.IntegrationServicesState
|
||||
$item.integration_services_version = $vm.IntegrationServicesVersion
|
||||
$item.integration_services_version = $vm.IntegrationServicesVersion.toString()
|
||||
$item.note = $note
|
||||
|
||||
$services = New-Object System.Collections.Generic.List[Hashtable];
|
||||
Foreach ($service in $VM.VMIntegrationService) {
|
||||
$service = @{}
|
||||
|
||||
$service.name = $service.Name
|
||||
$service.enabled = $service.Enabled
|
||||
$service.primary_operational_status = $service.PrimaryOperationalStatus.value__
|
||||
$service.secondary_operational_status = $service.SecondaryOperationalStatus.value__
|
||||
$services.Add($service)
|
||||
$services = New-Object System.Collections.Generic.List[Hashtable];
|
||||
Foreach ($service in $vm.VMIntegrationService) {
|
||||
$item_service = @{}
|
||||
|
||||
$item_service.service = $service.Name
|
||||
$item_service.enabled = $service.Enabled
|
||||
$item_service.primary_operational_status = $service.PrimaryOperationalStatus.value__
|
||||
$item_service.secondary_operational_status = $service.SecondaryOperationalStatus.value__
|
||||
$services.Add($item_service)
|
||||
}
|
||||
|
||||
$item.services = $services
|
||||
|
|
Loading…
Reference in New Issue