Sha256: dfab6ee2709b0971b69731cc07725130e141d216ed988257c625e2ede289654e

Contents?: true

Size: 1.25 KB

Versions: 7

Compression:

Stored size: 1.25 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 = Hyper-V\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"){
            Hyper-V\Enable-VMIntegrationService -VM $Vm -Name $Name
        }
        if($Value -eq "false"){
            Hyper-V\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

7 entries across 7 versions & 2 rubygems

Version Path
vagrant-unbundled-2.1.1.0 plugins/providers/hyperv/scripts/set_vm_integration_services.ps1
vagrant-unbundled-2.0.4.0 plugins/providers/hyperv/scripts/set_vm_integration_services.ps1
vagrant-unbundled-2.0.3.0 plugins/providers/hyperv/scripts/set_vm_integration_services.ps1
vagrant-aws-detiber-0.7.2.pre.4 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-419afb4dcffe/plugins/providers/hyperv/scripts/set_vm_integration_services.ps1
vagrant-aws-detiber-0.7.2.pre.3 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-419afb4dcffe/plugins/providers/hyperv/scripts/set_vm_integration_services.ps1
vagrant-aws-detiber-0.7.2.pre.2 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-419afb4dcffe/plugins/providers/hyperv/scripts/set_vm_integration_services.ps1
vagrant-unbundled-2.0.2.0 plugins/providers/hyperv/scripts/set_vm_integration_services.ps1