Skip to content

Instantly share code, notes, and snippets.

@jseguillon
Last active April 19, 2020 17:19
Show Gist options
  • Save jseguillon/246f212edef40244491e953ee1e0ae60 to your computer and use it in GitHub Desktop.
Save jseguillon/246f212edef40244491e953ee1e0ae60 to your computer and use it in GitHub Desktop.
Vagrant - power shell script
$countItf=(Get-VMNetworkAdapter -VMName $vmName | Where-Object {$_.MacAddress -match $macAddrCtrlPlane}).count
If ($countItf -ne 1) {
echo "Adding itf to vm"
Stop-VM -VMName $vmName
Add-VMNetworkAdapter -VMName $vmName -SwitchName "Default Switch" -StaticMacAddress $macAddrCtrlPlane
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment