mirror of
https://github.com/hashicorp/vagrant.git
synced 2026-02-21 08:55:35 -05:00
16 lines
338 B
PowerShell
16 lines
338 B
PowerShell
#Requires -Modules VagrantMessages
|
|
|
|
param (
|
|
[parameter (Mandatory=$true)]
|
|
[string]$VmId,
|
|
[parameter (Mandatory=$true)]
|
|
[int]$VlanId
|
|
)
|
|
|
|
try {
|
|
$vm = Hyper-V\Get-VM -Id $VmId -ErrorAction "stop"
|
|
Hyper-V\Set-VMNetworkAdapterVlan $vm -Access -Vlanid $VlanId
|
|
}
|
|
catch {
|
|
Write-ErrorMessage "Failed to set VM's Vlan ID $_"
|
|
}
|