diff --git a/Guests/RTR-01.ps1 b/Guests/RTR-01.ps1 index 4322b02..7818eaa 100644 --- a/Guests/RTR-01.ps1 +++ b/Guests/RTR-01.ps1 @@ -11,6 +11,7 @@ echo "Shamefully made by Alexandre Simao. Pardon-me M. Stallman" Rename-computer RTR-01 $adapter = Get-NetAdapter | ? {$_.MacAddress -eq "00-15-5D-02-70-00"} +Rename-NetAdapter -Name "Eth*" -NewName "Arc-SRV" #Arc-SRV $IP = "192.168.8.1" diff --git a/Guests/SRV-01_DHCP.ps1 b/Guests/SRV-01_DHCP.ps1 index 9cbe430..14f6197 100644 --- a/Guests/SRV-01_DHCP.ps1 +++ b/Guests/SRV-01_DHCP.ps1 @@ -3,8 +3,8 @@ # SRV-01 ONLY # TODO : exclusion/attribution fields -# Rename interfaces -# +# Rename interfaces +# echo "Shamefully made by Alexandre Simao. Pardon-me M. Stallman" #Rename this piece of garbage diff --git a/Host/Infra-Standard.ps1 b/Host/Infra-Standard.ps1 index 1e3ddb5..7d1da6d 100644 --- a/Host/Infra-Standard.ps1 +++ b/Host/Infra-Standard.ps1 @@ -49,8 +49,8 @@ New-VM @vms Set-VMMemory RTR-01 -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB $vmadapter = Get-VMNetworkAdapter -VMName "RTR-01" Set-VMNetworkAdapter -VMNetworkAdapter $vmadapter[0] -StaticMacAddress 00155D027001 -Add-VMNetworkAdapter -VMName "RTR-01" -SwitchName "Arc-CLI" -StaticMacAddress 00155D027002 -Add-VMNetworkAdapter -VMName "RTR-01" -SwitchName "WAN" -StaticMacAddress 00155D027003 +Add-VMNetworkAdapter -VMName "RTR-01" -SwitchName "Arc-CLI" +Add-VMNetworkAdapter -VMName "RTR-01" -SwitchName "WAN" # RTR-02 diff --git a/Memo.ps1 b/Memo.ps1 index a64c543..9839beb 100644 --- a/Memo.ps1 +++ b/Memo.ps1 @@ -33,3 +33,9 @@ Get-VMNetworkAdapter -VMName "Virtual 2008 1" | Where-Object -Property MacAddres Get-NetAdapter |Where-Object {$_.MacAddress -eq 'XX-XX-XX-XX'} | Select-Object` -Property Name | Format-Table -HideTableHeaders + +$adapts = Get-NetAdapter +foreach ($adapt in $adapts) { +$HWName = (Get-NetAdapterAdvancedProperty -name $adapt.name -DisplayName "Hyper-v Network Adapter Name").DisplayValue +Rename-Netadapter -name $adapt.name -NewName $HWName +}