Sha256: 6b4b017bac7733687c6e738e45f116b547824ebc4ac2f570f318e927ef5bd396

Contents?: true

Size: 1.22 KB

Versions: 11

Compression:

Stored size: 1.22 KB

Contents

param (
    [string] $VmId,
    [string] $guest_service_interface = $null,
    [string] $heartbeat = $null,
    [string] $key_value_pair_exchange = $null,
    [string] $shutdown = $null,
    [string] $time_synchronization = $null,
    [string] $vss = $null
)

# Include the following modules
$Dir = Split-Path $script:MyInvocation.MyCommand.Path
. ([System.IO.Path]::Combine($Dir, "utils\write_messages.ps1"))

$vm = Get-VM -Id $VmId -ErrorAction "stop"

# Set the service based on value
function VmSetService
{
    param ([string] $Name, [string] $Value, [Microsoft.HyperV.PowerShell.VirtualMachine] $Vm)

    if ($Value -ne $null){
        if($Value -eq "true"){
            Enable-VMIntegrationService -VM $Vm -Name $Name
        }
        if($Value -eq "false"){
            Disable-VMIntegrationService -VM $Vm -Name $Name
        }
    }
}

VmSetService -Name "Guest Service Interface" -Value $guest_service_interface -Vm $vm
VmSetService -Name "Heartbeat" -Value $heartbeat -Vm $vm
VmSetService -Name "Key-Value Pair Exchange" -Value $key_value_pair_exchange -Vm $vm
VmSetService -Name "Shutdown" -Value $shutdown -Vm $vm
VmSetService -Name "Time Synchronization" -Value $time_synchronization -Vm $vm
VmSetService -Name "VSS" -Value $vss -Vm $vm

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
vagrant-unbundled-2.0.1.0 plugins/providers/hyperv/scripts/set_vm_integration_services.ps1
vagrant-aws-mkubenka-0.7.2.pre.22 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-f3fdbf414272/plugins/providers/hyperv/scripts/set_vm_integration_services.ps1
vagrant-aws-mkubenka-0.7.2.pre.16 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-1ee58c40e3f5/plugins/providers/hyperv/scripts/set_vm_integration_services.ps1
vagrant-unbundled-2.0.0.1 plugins/providers/hyperv/scripts/set_vm_integration_services.ps1
vagrant-unbundled-1.9.8.1 plugins/providers/hyperv/scripts/set_vm_integration_services.ps1
vagrant-unbundled-1.9.7.1 plugins/providers/hyperv/scripts/set_vm_integration_services.ps1
vagrant-aws-mkubenka-0.7.2.pre.14 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/providers/hyperv/scripts/set_vm_integration_services.ps1
vagrant-aws-mkubenka-0.7.2.pre.11 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/providers/hyperv/scripts/set_vm_integration_services.ps1
vagrant-aws-mkubenka-0.7.2.pre.10 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/providers/hyperv/scripts/set_vm_integration_services.ps1
vagrant-aws-mkubenka-0.7.2.pre.9 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/providers/hyperv/scripts/set_vm_integration_services.ps1
vagrant-unbundled-1.9.5.1 plugins/providers/hyperv/scripts/set_vm_integration_services.ps1