Last active
April 19, 2020 17:19
-
-
Save jseguillon/246f212edef40244491e953ee1e0ae60 to your computer and use it in GitHub Desktop.
Vagrant - power shell script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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