Sha256: 9b4ac9dee949ccc9ca3efd28aac9ea14e25704106d628b7bf018fd6ffafc50a1

Contents?: true

Size: 781 Bytes

Versions: 28

Compression:

Stored size: 781 Bytes

Contents

#requires -Version 2 -Modules Hyper-V

#implicitly import hyperv module to avoid powercli cmdlets
if ((Get-Module -Name 'hyper-v') -ne $null) {
  Remove-Module -Name hyper-v
  Import-Module -Name hyper-v
}
else {
  Import-Module -Name hyper-v
}

$ProgressPreference = 'SilentlyContinue'

function Get-DefaultVMSwitch {
  [CmdletBinding()]
  param ($Name)

  $switches = Get-VMSwitch @PSBoundParameters
  
  if (-not $PSBoundParameters.ContainsKey('Name') -and (($switches.Name) -contains 'Default Switch') ) {
      # Looking for 'Default Switch' on Fall Creators Update or newer
      $switches = $switches | 
          Where-Object {$_.Name -like 'Default Switch'}    
  }

  $switches | 
      Select-Object -first 1 | 
      Select-Object Name, ID
}

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
kitchen-vagrant-2.0.1 support/hyperv.ps1
kitchen-vagrant-2.0.0 support/hyperv.ps1
kitchen-vagrant-1.14.2 support/hyperv.ps1
kitchen-vagrant-1.14.1 support/hyperv.ps1
kitchen-vagrant-1.14.0 support/hyperv.ps1
kitchen-vagrant-1.13.0 support/hyperv.ps1
kitchen-vagrant-1.12.1 support/hyperv.ps1
kitchen-vagrant-1.12.0 support/hyperv.ps1
kitchen-vagrant-1.11.0 support/hyperv.ps1
kitchen-vagrant-1.10.0 support/hyperv.ps1
kitchen-vagrant-1.9.0 support/hyperv.ps1
kitchen-vagrant-1.8.0 support/hyperv.ps1
kitchen-vagrant-1.7.2 support/hyperv.ps1
kitchen-vagrant-1.7.1 support/hyperv.ps1
kitchen-vagrant-1.7.0 support/hyperv.ps1
kitchen-vagrant-1.6.1 support/hyperv.ps1
kitchen-vagrant-1.6.0 support/hyperv.ps1
kitchen-vagrant-1.5.2 support/hyperv.ps1
kitchen-vagrant-1.5.1 support/hyperv.ps1
kitchen-vagrant-1.5.0 support/hyperv.ps1